gwpopulation_pipe.data_analysis.resample_single_event_posteriors

resample_single_event_posteriors(likelihood, result, save=True)[source]

Resample the single event posteriors to use the population-informed prior.

Parameters:
likelihood: gwpopulation.hyperpe.HyperparameterLikelihood

The likelihood object to use.

result: bilby.core.result.Result

The result whose posterior should be used for the reweighting.

save: bool

Whether to save the samples to file. If False the samples will be returned.

Returns:
original_samples: dict

The input samples with the new prior weights in a new weights entry.

reweighted_samples: dict

The input samples resampled in place according to the new prior weights. Note that this will cause samples to be repeated.