dingo.gw.inference package
Submodules
dingo.gw.inference.context module
Per-event sampler context for gravitational-wave inference: the event data and its derived views – the network-input representation, the prior, and the likelihood.
- class dingo.gw.inference.context.GWSamplerContext(domain, data_prep: Compose, event_data: dict, event_metadata: dict | None = None, model_metadata: dict | None = None, device: device | str = 'cpu', data_prep_conditioning: list[str] | None = None)
Bases:
objectPer-event shared state for a chain of gravitational-wave steps: the event data and everything derived from it.
The context implements the dingo.core.inference.context.SamplerContext protocol for this domain family. It prepares the network-input view of the data (prepared_data), builds the prior (prior) and the exact likelihood (likelihood), and carries the per-event metadata: the event time, which sets the likelihood reference time and the right-ascension frame correction, and any per-event analysis settings such as a frequency-range update.
A context is immutable. It is built once from an event dataset and the model metadata. The likelihood works on whatever frequency grid the event data are on: for importance sampling, the pipe generates data for the requested frequency range and duration and builds a new context from them. Whether a multibanded model’s likelihood uses the base domain is an argument of likelihood(), like the marginalizations.
The representation vocabulary here (frequency domains, multibanded decimation, the base-domain likelihood view, frequency-range masking) is specific to this domain family. A new domain family should get its own context class implementing the same interface rather than extending this one.
- Parameters:
domain (Domain) – The frequency domain the network was trained on, used to prepare the network input. The likelihood uses the grid of the event data instead.
data_prep (Compose) – The one-time data-preprocessing transform chain (whiten / decimate / repackage).
event_data (dict) – The raw event data d (strain + ASDs per detector), i.e. EventDataset.data. Consumed lazily by prepared_data() and reused for the likelihood. An injection dict (Injection.injection()) may also carry its truths under “parameters”; these are moved to event_metadata[“injection_parameters”].
event_metadata (dict, optional) – Per-event metadata: the grid the event data are on, the analyzed detectors, the per-detector frequency range and PSD notches, the RA correction, and the likelihood reference time.
model_metadata (dict, optional) – The metadata of the model defining this analysis (dataset + train settings); the source for the prior, the likelihood, the detector names, and the reference time.
device (torch.device or str, default "cpu") – The torch device the chain runs on (the model device); steps that create fresh tensors (e.g. DeltaFactor) create them here.
data_prep_conditioning (list[str], optional) – Names of the chain-conditioning parameters the data preparation is a function of (e.g. [“chirp_mass_proxy”] for a heterodyning model). prepared_data requires their values, injects them into the transform chain, and keys its cache on them; the values themselves have a single owner – the chain.
- property detectors: list[str]
the event record’s, else the training list.
- Type:
The analyzed detectors
- classmethod from_model(model: BasePosteriorModel, event_data: dict, event_metadata: dict | None = None) GWSamplerContext
Build the context from a model: its own metadata and its device. Data preparation is network-bound, so the settings come from model.metadata (for a conditional model this equals the base analysis metadata). An unconditional model prepares no data, so no context can be built from one; for the prior/likelihood views alone, use from_model_metadata(model.base_metadata, …).
- Parameters:
model (BasePosteriorModel) – The (conditional) model whose metadata defines the domain and preprocessing.
event_data (dict) – The raw event data (strain + ASDs).
event_metadata (dict, optional) – Per-event metadata.
- Return type:
- classmethod from_model_metadata(metadata: dict, event_data: dict, event_metadata: dict | None = None, device: device | str = 'cpu') GWSamplerContext
Build the context from a model-metadata dict – no model required. The domain, one-time data-prep chain, prior, and likelihood are all defined by the metadata (e.g. a saved Result.settings); device only sets where prepared_data() and chain-created tensors live.
- Parameters:
metadata (dict) – Conditional-model metadata (dataset_settings + train_settings), e.g. the settings of a saved Result.
event_data (dict) – The raw event data (strain + ASDs).
event_metadata (dict, optional) – Per-event metadata.
device (torch.device or str, default "cpu") – Device for prepared_data() and chain-created tensors.
- Return type:
- likelihood(time_marginalization_kwargs: dict | None = None, phase_marginalization_kwargs: dict | None = None, calibration_marginalization_kwargs: dict | None = None, use_base_domain: bool = False) StationaryGaussianGWLikelihood
Build the exact GW likelihood on this event’s data, in physical parameter space.
The likelihood does not depend on the network. It works on the frequency grid of the event data, which the pipe generates to cover the requested frequency range, whether inside the network’s band or beyond it. Each detector’s frequency range comes from the event metadata: the ASDs are masked outside it, and the calibration spline nodes are placed across it. For a multibanded model the data are decimated onto the bands unless use_base_domain is set; decimation needs the data on the network’s own grid. The reference time is the event time, or the training reference time when no event time is set.
The most recently built likelihood is cached: a repeated call with the same arguments returns the shared instance, and a call with different arguments builds a replacement.
- Parameters:
time_marginalization_kwargs (dict, optional) – Analytically marginalize over geocent_time. Must carry explicit t_lower / t_upper bounds; the caller (the importance-sampling layer of Result) supplies them from its prior. Requires a time-marginalized network.
phase_marginalization_kwargs (dict, optional) – Analytically marginalize over phase. Requires a uniform [0, 2 pi) phase prior.
calibration_marginalization_kwargs (dict, optional) – Marginalize over detector calibration uncertainty.
use_base_domain (bool, default False) – For a multibanded model, evaluate on the undecimated base domain.
- Return type:
- prepared_data(conditioning=None)
The event data in the representation the networks condition on: one tensor, or for a tokenized (transformer) network the list [waveform, position, token_mask].
Called without conditioning, this returns the single shared representation, computed once and cached. Called with conditioning (the chain columns available to a conditioned factor), the result has one data row per conditioning row. Only the columns named in data_prep_conditioning affect the preparation (for example the chirp-mass heterodyne proxy); the other columns condition the network alone. When the consumed value is the same in every row (a pinned proxy), the data are prepared once and viewed across the rows; when it varies (a sweep), the whole batch runs through the transform chain in one pass, uncached, so a caller sweeping a large grid should split it into blocks.
The event’s network-input settings (analyzed detectors, frequency range, PSD notches) are validated against the training licenses before any preparation.
- Parameters:
conditioning (dict[str, torch.Tensor], optional) – The chain conditioning available to the calling factor, one value per row. May contain columns irrelevant to the preparation.
- Return type:
torch.Tensor or list of torch.Tensor
- property prior: PriorDict
The static prior over all parameters, built once from the model metadata (intrinsic + extrinsic priors with Dingo defaults).
This is the event-independent prior fixed at training time. Importance-sampling prior-bound updates and the time / phase split-off for marginalized networks are applied downstream (they depend on the evolving analysis state), not here.
- property t_ref: float
Training reference GPS time, read from the model metadata.
dingo.gw.inference.sampler module
The composed gravitational-wave sampler and its chain builders.
- class dingo.gw.inference.sampler.GWComposedSampler(composer: ChainComposer, context: GWSamplerContext)
Bases:
ComposedSamplerGW builder and exporter over the generic ComposedSampler runner. The from_* constructors assemble the chain for plain NPE, multi-iteration GNPE, or single-step GNPE from model metadata; to_result exports the samples to a gw Result, with the model metadata and the sampler provenance as its settings. All GW-specific processing (RA frame, fixed parameters, kernel correction) is expressed as chain steps, so there is no post-processing.
- Parameters:
composer (ChainComposer) – The assembled chain of steps.
context (GWSamplerContext) – Per-event shared state; its model metadata is carried through to the exported Result.
- classmethod from_gnpe_models(init_model: BasePosteriorModel, main_model: BasePosteriorModel, event_data: dict, event_metadata: dict | None = None, num_iterations: int = 30) GWComposedSampler
Build a multi-iteration time-GNPE sampler from an init + main model pair.
The chain is a single GibbsBlock – seeded by the init network, then cycling the GNPE kernel and the main network for num_iterations sweeps – followed by an RAToEventFrame rotation. The context is built from the main model; the init model must share its data preprocessing (asserted). The chain is density-free: the samples carry no log_prob, and the density must be recovered before importance sampling.
- Parameters:
init_model (BasePosteriorModel) – The init network (detector times); seeds the Gibbs loop and defines the data preprocessing.
main_model (BasePosteriorModel) – The GNPE main network.
event_data (dict) – The raw event data (strain + ASDs).
event_metadata (dict, optional) – Per-event metadata.
num_iterations (int, default 30) – Number of Gibbs sweeps.
- Return type:
- classmethod from_model(model: BasePosteriorModel, event_data: dict, event_metadata: dict | None = None, fixed_context_parameters: dict | None = None) GWComposedSampler
Build a single-network GW sampler from a model and event data.
For a plain NPE model the chain is the flow, followed by an RAToEventFrame rotation to the event frame. A model with context_parameters (e.g. the DINGO-BNS chirp-mass prior conditioning) requires fixed_context_parameters pinning all of them: the chain is then rooted in a DeltaFactor of the pins, the flow conditions on them, and each inferred offset delta_X with a pinned proxy is reconstructed by a ProxyOffsetReparam (X = delta_X + X_proxy). Proxies that parameterize the data preparation (the chirp-mass heterodyne) are read from the chain by prepared_data. A time-GNPE model is rejected: its data must be time-shifted by the proxies, which is the job of the GNPE builders.
- Parameters:
model (BasePosteriorModel) – The model.
event_data (dict) – The raw event data (strain + ASDs).
event_metadata (dict, optional) – Per-event metadata.
fixed_context_parameters (dict, optional) – Pinned values for the model’s context_parameters, e.g. {“chirp_mass_proxy”: 1.1975, “ra”: 3.446, “dec”: -0.408}.
- Return type:
- Raises:
ValueError – For a time-GNPE model, or when the pinned keys do not match the model’s context_parameters.
- classmethod from_singlestep_gnpe(main_model: BasePosteriorModel, proxy_source: Factor, event_data: dict, event_metadata: dict | None = None) GWComposedSampler
Build a single-step (density-preserving) time-GNPE sampler.
The chain is [proxy_source, GNPEFlowFactor, GNPEKernelCorrection, RAToEventFrame]: the proxy source supplies the detector-time proxies, the main network draws conditioned on them, and the kernel correction emits the delta_log_prob_target column that importance sampling adds to the target. Every step has a tractable density, so the samples carry a log_prob.
- Parameters:
main_model (BasePosteriorModel) – The GNPE main network.
proxy_source (Factor) – Supplies the detector-time proxies: a DeltaFactor of fixed proxies, or an unconditional NDE for density recovery.
event_data (dict) – The raw event data (strain + ASDs).
event_metadata (dict, optional) – Per-event metadata.
- Return type:
- property metadata: dict
The model metadata defining the analysis (from the context).
- to_hdf5(label='result', outdir='.')
Export via to_result and save to <outdir>/<label>.hdf5.
- to_result()
Export to a gw Result (samples + raw event data + metadata), so the existing post-processing pipeline – synthetic phase, importance sampling, evidence, plotting – runs on the factorized sampler’s output unchanged.
The raw event-data dict (GWSamplerContext.event_data) is stored as the Result context (serialized), and the live GWSamplerContext is passed as sampler_context, so Result uses its prior and likelihood rather than rebuilding them from metadata.
- dingo.gw.inference.sampler.single_network_steps(model, prior) list
The steps of a single-network chain, without its root.
That is: the flow (with the right-ascension frame adjustments for a pinned or inferred sky position), the proxy-offset reconstructions, the rotation to the event frame, and the delta-prior fillers. from_model prepends a DeltaFactor of the pins when the model has context parameters; the chirp-mass scan prepends a SampleTableFactor with one row per proxy grid point.
- Parameters:
model (BasePosteriorModel) – The (conditional) model.
prior (PriorDict) – The static prior (GWSamplerContext.prior), for the delta-prior fillers.
- Return type:
list of chain steps
dingo.gw.inference.scan module
Chirp-mass scan for prior-conditioned (DINGO-BNS) networks.
A chirp-mass-conditioned network infers parameters relative to a proxy value that must be supplied per event. When no external trigger value is available, this scan determines it from the data: sweep the proxy over the training chirp-mass prior, draw a few samples per grid point in batched network passes, and take the chirp mass of the maximum-likelihood draw (Dax et al., Nature 639, 49 (2025), Methods).
The sweep runs on the ordinary chain machinery: a SampleTableFactor roots the chain in the pin table (one row per grid point), the conditioned FlowFactor draws num_samples per row against per-row prepared data (the row-varying heterodyne), and the usual reconstruction steps follow. The winner is selected with a phase-marginalized likelihood on the (base-domain) event data.
- dingo.gw.inference.scan.chirp_mass_scan(model, event_data: dict, event_metadata: dict | None = None, fixed_context_parameters: dict | None = None, *, num_samples: int = 10, overlap_factor: int = 2, block_size: int = 32, num_processes: int = 1) dict
Scan for the trigger chirp mass of an event.
Draws num_samples posterior samples at each grid value of the chirp-mass proxy (one batched network pass over the whole grid), evaluates a phase-marginalized likelihood for every within-prior draw, and returns the maximum-likelihood draw’s chirp mass as the trigger value.
- Parameters:
model (BasePosteriorModel) – A chirp-mass-conditioned model (trained with gnpe_chirp).
event_data (dict) – The raw event data (strain + ASDs).
event_metadata (dict, optional) – Per-event metadata.
fixed_context_parameters (dict, optional) – Fixed values for the model’s remaining (non-proxy) context parameters, e.g. the sky position for a sky-conditioned network. The scan fills chirp_mass_proxy itself.
num_samples (int, default 10) – Draws per grid point.
overlap_factor (int, default 2) – Grid points per kernel width.
block_size (int, default 32) – Grid points per sweep block; bounds the transient memory of the row-wise data preparation and the network batch.
num_processes (int, default 1) – Parallel processes for the likelihood evaluations.
- Returns:
chirp_mass_trigger (the winner), snr and max_log_likelihood (its trigger quality), grid, samples (all within-prior draws with their log_likelihood and snr), and settings (the scan configuration).
- Return type:
dict
- dingo.gw.inference.scan.chirp_mass_scan_grid(model_metadata: dict, overlap_factor: int = 2) ndarray
Proxy grid spanning the training chirp-mass prior at kernel_width / overlap_factor spacing, with the bounds inset by the kernel edges so that every chirp mass in the prior is within the kernel of some grid point.
- Parameters:
model_metadata (dict) – The model metadata (with dataset_settings and train_settings).
overlap_factor (int, default 2) – Grid points per kernel width.
- Returns:
The proxy grid (float64).
- Return type:
np.ndarray
dingo.gw.inference.steps module
Gravitational-wave chain steps: the GNPE factors, the synthetic-phase factor, and the coordinate reparametrizations.
- class dingo.gw.inference.steps.GNPEFlowFactor(model: BasePosteriorModel, aliases: dict[str, str] | None = None)
Bases:
FactorThe GNPE main network q(theta | theta_hat, d) as a factor.
Conditions on the detector-time proxies from GNPEKernelFactor: it shifts each detector’s strain by the corresponding proxy time (standardizing the network input), samples the network, and recomputes the detector times from the sampled sky position and geocent time. The proxies are supplied, so no blurring happens here.
The single network factor in either GNPE mode: cycled by a GibbsBlock for multi-iteration GNPE, or a ChainComposer factor for single-step GNPE. The recomputed detector times are emitted as extra columns (produces): the next Gibbs iteration blurs them into fresh proxies, and single-step GNPE evaluates the kernel correction at them. Draws num_samples per proxy row (one in the Gibbs loop).
- Parameters:
model (BasePosteriorModel) – The GNPE main network; the per-iteration transforms are built from its metadata.
aliases (dict[str, str], optional) – Trained-name to exposed-name map (e.g. {“ra”: “ra@t_ref”}).
- log_prob(theta_i, context, given=None)
Evaluate the network density log q(theta | theta_hat, d) in physical space at given theta_i (exposed / aliased names), one row per proxy row in given. Applies the same per-row view of the data as sampling (the shared representation time-shifted by the proxies, the conditioning standardized), then scores the standardized parameters under the network.
- property produces: list[str]
the inference block plus the recomputed detector times.
- Type:
Emitted columns
- sample_and_log_prob(num_samples, context, given=None)
Draw num_samples parameter sets per proxy row (the draws for a row are adjacent). Returns theta plus the recomputed detector times, and the network log-prob. In the Gibbs loop and with a drawing proxy source this is called with num_samples=1; a value greater than 1 arises only when the proxy source is pinned. See Factor.sample_and_log_prob.
- class dingo.gw.inference.steps.GNPEKernelCorrection(kernel_factor: GNPEKernelFactor)
Bases:
TargetCorrectionThe single-step GNPE kernel correction, as a target-side chain step.
Single-step GNPE samples from the joint proposal q(theta, theta_hat | d) over parameters and proxies, so the matching importance-sampling target acquires the kernel term p(theta_hat | theta). This step evaluates that term at the proxies and at the detector times the main network recomputed from theta, and emits it as the delta_log_prob_target column. It contributes zero to the proposal density. The recomputed detector times it reads are a side channel of the main network, not part of the output.
- Parameters:
kernel_factor (GNPEKernelFactor) – The kernel whose density is evaluated; also names the proxy and detector-time columns.
- correction(given, context)
Compute the correction column(s).
- Parameters:
given (dict[str, torch.Tensor]) – The conditioning columns, one row each.
context (SamplerContext) – The per-event shared state.
- Returns:
The emitted column(s), one value per row.
- Return type:
dict[str, torch.Tensor]
- class dingo.gw.inference.steps.GNPEKernelFactor(model: BasePosteriorModel)
Bases:
FactorThe GNPE perturbation kernel p(theta_hat | theta) as a non-network factor.
theta are the detector coalescence times; the kernel adds a bounded perturbation to each, giving the proxies theta_hat the main network conditions on. The parameter block is the proxies, the conditioning is the detector times. sample_and_log_prob blurs the times into proxies (the proxy update of a Gibbs sweep); log_prob returns the kernel density log p(theta_hat | theta) at the proxies and the detector times. One proxy per detector-time row.
- Parameters:
model (BasePosteriorModel) – The GNPE main network; its metadata defines the kernel and the detector-time parameters.
- log_prob(theta_i, context, given=None)
log p(theta_hat | theta) from the kernel, at the proxies (theta_i) and the detector times (given).
The kernel is a bilby PriorDict – the same object that samples the blur – so the density is evaluated in numpy (converting each side first: the times and proxies may live on different devices) and returned on the detector times’ device.
- sample_and_log_prob(num_samples, context, given=None)
Blur the conditioning detector times into proxies; num_samples must be 1 (GNPE is 1:1). Returns the proxies and their kernel log-prob.
- class dingo.gw.inference.steps.RAToEventFrame
Bases:
ReparametrizationRotate right ascension from the network’s training reference frame (ra@t_ref) to the event frame (ra).
The network is trained at a fixed reference time; an event at a different GPS time needs the sky rotated by the sidereal-time difference. This is a measure-preserving shift modulo 2*pi (log_det = 0), so it contributes nothing to the density. forward produces the event-frame ra, inverse recovers ra@t_ref. The sidereal correction is read from the shared context (t_ref and the event time).
The modulo makes the map a bijection on the circle, while the flow’s density lives on the real line: a sample drawn outside [0, 2 pi) is wrapped, so inverse recovers its principal-branch representative and a re-evaluated log_prob refers to that branch. Only tail samples outside the bounded ra prior are affected.
- forward(given, context)
Apply the change of variables.
- Parameters:
given (dict[str, torch.Tensor]) – The inputs and conditioning columns, one row each.
context (SamplerContext) – The per-event shared state.
- Returns:
The parameters columns.
- Return type:
dict[str, torch.Tensor]
- inverse(params, context, given=None)
Rebuild the inputs from the produced parameters.
- Parameters:
params (dict[str, torch.Tensor]) – The parameters columns, one row each.
context (SamplerContext) – The per-event shared state.
given (dict[str, torch.Tensor], optional) – The read-only conditioning columns, still in the chain, for example a proxy the map shifts by. Maps that depend only on their own outputs may ignore it.
- Returns:
The inputs columns.
- Return type:
dict[str, torch.Tensor]
- class dingo.gw.inference.steps.RAToTrainingFrame
Bases:
RAToEventFrameRotate a pinned event-frame right ascension (ra) into the network’s training frame (ra@t_ref): the input-side mirror of RAToEventFrame.
A sky position pinned at the event time must be presented to the network in the frame it was trained in. A trailing RAToEventFrame then restores the event-frame value in the samples.
- forward(given, context)
Apply the change of variables.
- Parameters:
given (dict[str, torch.Tensor]) – The inputs and conditioning columns, one row each.
context (SamplerContext) – The per-event shared state.
- Returns:
The parameters columns.
- Return type:
dict[str, torch.Tensor]
- inverse(params, context, given=None)
Rebuild the inputs from the produced parameters.
- Parameters:
params (dict[str, torch.Tensor]) – The parameters columns, one row each.
context (SamplerContext) – The per-event shared state.
given (dict[str, torch.Tensor], optional) – The read-only conditioning columns, still in the chain, for example a proxy the map shifts by. Maps that depend only on their own outputs may ignore it.
- Returns:
The inputs columns.
- Return type:
dict[str, torch.Tensor]
- class dingo.gw.inference.steps.SpinConventionReparam(num_processes: int = 1)
Bases:
ReparametrizationRelabel the precessing-spin angles between Dingo’s internal spin convention and the physical (Bilby) one.
Dingo fixes the spin-conversion phase (usually to 0) so that the Cartesian spins decouple from the coalescence phase. Sampling, likelihood, and synthetic phase all work in that convention, and stored samples keep the plain names theta_jn / phi_jl in it. The physical convention (spin conversion at the sample’s own phase) is what Bilby and PESummary mean by the same names, so the relabel happens when samples are exported. Only theta_jn and phi_jl change; the conversion phase and reference frequency are read from the model metadata, and a model trained without a fixed conversion phase relabels to the identity.
Exporting a finished weighted sample set needs no Jacobian, since proposal, prior, and likelihood transform together; that is to_physical. As a chain step the map is not measure-preserving in the flat (theta_jn, phi_jl) coordinates: it rotates the line of sight rigidly about the orbital angular momentum, preserving the spherical measure sin(theta_jn) dtheta dphi, so log_det = log sin(theta_jn) - log sin(theta_jn’).
- Parameters:
num_processes (int, default 1) – Parallel processes for the per-sample LAL spin conversion.
- forward(given, context)
Apply the change of variables.
- Parameters:
given (dict[str, torch.Tensor]) – The inputs and conditioning columns, one row each.
context (SamplerContext) – The per-event shared state.
- Returns:
The parameters columns.
- Return type:
dict[str, torch.Tensor]
- inverse(params, context, given=None)
Rebuild the inputs from the produced parameters.
- Parameters:
params (dict[str, torch.Tensor]) – The parameters columns, one row each.
context (SamplerContext) – The per-event shared state.
given (dict[str, torch.Tensor], optional) – The read-only conditioning columns, still in the chain, for example a proxy the map shifts by. Maps that depend only on their own outputs may ignore it.
- Returns:
The inputs columns.
- Return type:
dict[str, torch.Tensor]
- log_det(given, context)
log|det J| of forward, per row. The map preserves the spherical measure, so the flat-coordinate Jacobian is sin(theta_jn) / sin(theta_jn’) – verified numerically against finite differences through the LAL conversion in test_jacobian_matches_sin_ratio (agreement ~1e-9).
- sample_and_log_prob(num_samples, context, given=None)
Apply forward; contribute -log|det J|. Overridden to share the single LAL conversion between the transform and its Jacobian (the base implementation would convert twice).
- to_network(samples: DataFrame, model_metadata: dict) DataFrame
Relabel samples from the physical (Bilby) convention to the model’s, e.g. to ingest external posteriors for comparison.
- to_physical(samples: DataFrame, model_metadata: dict) DataFrame
Relabel samples from the model’s convention to the physical (Bilby) one.
- class dingo.gw.inference.steps.SyntheticPhaseFactor(conditioning: list[str], n_grid: int = 5001, approximation_22_mode: bool = False, uniform_weight: float = 0.01, num_processes: int = 1, use_base_domain: bool = False)
Bases:
FactorReconstruct the coalescence phase for a phase-marginalized network: the factor q(phase | theta_rest, d), built from the likelihood on a phase grid.
For each incoming sample the factor evaluates log L on a grid over [0, 2 pi). A single waveform evaluation per sample suffices, because the waveform modes computed at phase = 0 each transform as exp(-i m phase). The grid is exponentiated into a conditional phase distribution, a uniform floor (weight uniform_weight) keeps it positive everywhere so that importance sampling stays exact, and one phase is drawn per sample from the interpolated distribution. The returned log probability joins the chain’s proposal density; importance sampling then targets the phase-full posterior.
There are two grid modes. With approximation_22_mode=True the signal is assumed to be (2, 2)-dominated: the whole waveform transforms as exp(2i phase), so the grid follows from the complex overlap (d | h(phase=0)). With False the modes are summed exactly, which requires the waveform generator’s spin_conversion_phase = 0. The entry points differ on the default: this factor and dingo_pipe’s PhaseRecoveryDefault use the exact mode, while Result.sample_synthetic_phase defaults to the (2, 2) approximation when the key is omitted.
- Parameters:
conditioning (list[str]) – The physical parameters the likelihood needs to generate the waveform (everything the chain has produced except phase).
n_grid (int, default 5001) – Number of phase grid points on [0, 2 pi).
approximation_22_mode (bool, default False) – Use the (2, 2)-mode approximation instead of the exact mode sum.
uniform_weight (float, default 0.01) – Weight of the uniform floor added to the phase distribution for mass coverage.
num_processes (int, default 1) – Parallel processes for the per-sample likelihood evaluation and phase sampling.
use_base_domain (bool, default False) – For a multibanded model, evaluate the likelihood on the undecimated base domain (passed on to SamplerContext.likelihood).
- describe() dict
The default descriptor plus the phase-grid settings.
- log_prob(theta_i, context, given=None)
Evaluate log q(phase | theta_rest, d) at the given phases (re-plug / IS).
- sample_and_log_prob(num_samples, context, given=None)
Draw one phase per theta_rest row (num_samples must be 1); return the phases and their proposal log-prob log q(phase | theta_rest, d).
dingo.gw.inference.visualization module
- dingo.gw.inference.visualization.generate_cornerplot(*sample_sets, filename=None)
- dingo.gw.inference.visualization.load_ref_samples(ref_samples_file, drop_geocent_time=True)