Coverage for parallel_bilby/analysis/sample_space.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from bilby.gw import conversion
4def fill_sample(args):
5 """Fill the sample for a particular row in the posterior data frame.
7 This function is used inside a pool.map(), so its interface needs
8 to be a single argument that is then manually unpacked.
10 Parameters
11 ----------
12 args: tuple
13 (row number, row, likelihood)
15 Returns
16 -------
17 sample: array-like
19 """
20 ii, sample, likelihood = args
21 sample = dict(sample).copy()
22 marg_params = likelihood.parameters.copy()
23 likelihood.parameters.update(sample)
24 sample.update(likelihood.get_sky_frame_parameters())
25 sample = likelihood.generate_posterior_sample_from_marginalized_likelihood()
26 # Likelihood needs to have marg params to calculate correct SNR
27 likelihood.parameters.update(marg_params)
28 conversion.compute_snrs(sample, likelihood)
29 sample = conversion._generate_all_cbc_parameters(
30 sample,
31 likelihood.waveform_generator.waveform_arguments,
32 conversion.convert_to_lal_binary_black_hole_parameters,
33 )
34 return sample