Skip to content

existing: add nested dicts samples,psd,config,cali

Sebastian Khan requested to merge existing_dict into master

This MR allows you to load json existing results files implementing nested dictionary using the 'labels' as keys for each run in the results file.

examples

In [1]: from pesummary.gw.file.existing import GWExistingFile

In [2]: f=GWExistingFile('./posterior_samples.json')

In [3]: f.existing_calibration.keys()
Out[3]: dict_keys(['EXP1', 'EXP2'])


In [5]: f.existing_calibration['EXP1'].keys()
Out[5]: dict_keys(['H1', 'L1', 'V1'])

In [7]: f.existing_config.keys()
Out[7]: dict_keys(['EXP1', 'EXP2'])

In [8]: f.existing_samples_dict.keys()
Out[8]: dict_keys(['EXP1', 'EXP2'])

In [5]: f.existing_samples_dict['EXP1'].keys()
Out[5]: dict_keys(['H1_optimal_snr', 'L1_optimal_snr', 'V1_optimal_snr', 'log_likelihood', 'phase', 'phi_12', 'phi_jl', 'mass_ratio', 'geocent_time', 'ra', 'dec', 'luminosity_distance', 'psi', 'chirp_mass', 'a_1', 'a_2', 'tilt_1', 'tilt_2', 'theta_jn', 'mass_1', 'mass_2', 'total_mass', 'symmetric_mass_ratio', 'iota', 'spin_1x', 'spin_1y', 'spin_1z', 'spin_2x', 'spin_2y', 'spin_2z', 'chi_p', 'chi_eff', 'cos_tilt_1', 'cos_tilt_2', 'redshift', 'comoving_distance', 'mass_1_source', 'mass_2_source', 'total_mass_source', 'chirp_mass_source'])

Merge request reports

Loading