Commit 15db7783 authored by Colm Talbot's avatar Colm Talbot

change input parameters of samples_to_data_frame

parent 58aaf23f
......@@ -205,21 +205,23 @@ class Result(dict):
for key in self.prior:
prior_file.write(self.prior[key])
def samples_to_data_frame(self, waveform_generator=None, interferometers=None, priors=None):
def samples_to_data_frame(self, likelihood=None, priors=None, conversion_function=None):
"""
Convert array of samples to data frame.
Parameters
----------
waveform_generator: tupak.waveform_generator.WaveformGenerator, optional
If the waveform generator and interferometers are provided, the SNRs will be recorded.
interferometers: tupak.detector.Interferometer
If the waveform generator and interferometers are provided, the SNRs will be recorded.
likelihood: tupak.likelihood.Likelihood
Likelihood used for sampling.
priors: dict
Dictionary of prior object, used to fill in delta function priors.
conversion_function: function
Function which adds in extra parameters to the data frame,
should take the data_frame, likelihood and prior as arguments.
"""
data_frame = pd.DataFrame(self.samples, columns=self.search_parameter_keys)
tupak.conversion.generate_all_bbh_parameters(data_frame, waveform_generator, interferometers, priors)
if conversion_function is not None:
conversion_function(data_frame, likelihood, priors)
self.posterior = data_frame
def construct_cbc_derived_parameters(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment