... | @@ -20,9 +20,19 @@ PESUMMARY_FILE = base.format("PROD0_pesummary.h5") |
... | @@ -20,9 +20,19 @@ PESUMMARY_FILE = base.format("PROD0_pesummary.h5") |
|
lalinf_samples = h5py.File(LALINFERENCE_FILE, "r")
|
|
lalinf_samples = h5py.File(LALINFERENCE_FILE, "r")
|
|
lalinf_samples = lalinf_samples["lalinference/lalinference_nest/posterior_samples"]
|
|
lalinf_samples = lalinf_samples["lalinference/lalinference_nest/posterior_samples"]
|
|
pesummary_samples = read(PESUMMARY_FILE)
|
|
pesummary_samples = read(PESUMMARY_FILE)
|
|
|
|
pesummary_attributes = pesummary_samples.extra_kwargs[0]
|
|
pesummary_samples = pesummary_samples.samples_dict[PESUMMARY_LABEL]
|
|
pesummary_samples = pesummary_samples.samples_dict[PESUMMARY_LABEL]
|
|
|
|
|
|
|
|
lalinference_map["logL"] = "log_likelihood"
|
|
|
|
lalinference_map["logPrior"] = "log_prior"
|
|
|
|
lalinference_map["L1_cplx_snr_amp"] = "L1_matched_filter_abs_snr"
|
|
|
|
lalinference_map["L1_cplx_snr_arg"] = "L1_matched_filter_snr_angle"
|
|
|
|
lalinference_map["V1_cplx_snr_amp"] = "V1_matched_filter_abs_snr"
|
|
|
|
lalinference_map["V1_cplx_snr_arg"] = "V1_matched_filter_snr_angle"
|
|
|
|
lalinference_map["L1_optimal_snr"] = "L1_optimal_snr"
|
|
|
|
|
|
reverse_map = {item: key for key, item in lalinference_map.items()}
|
|
reverse_map = {item: key for key, item in lalinference_map.items()}
|
|
|
|
|
|
pesummary_dict = {}
|
|
pesummary_dict = {}
|
|
for param in pesummary_samples.keys():
|
|
for param in pesummary_samples.keys():
|
|
if param in reverse_map.keys():
|
|
if param in reverse_map.keys():
|
... | @@ -39,6 +49,7 @@ for param in lalinf_samples.dtype.names: |
... | @@ -39,6 +49,7 @@ for param in lalinf_samples.dtype.names: |
|
else:
|
|
else:
|
|
not_included.append(param)
|
|
not_included.append(param)
|
|
|
|
|
|
|
|
if len(not_included):
|
|
print("--------------------")
|
|
print("--------------------")
|
|
print("Parameters not included in this analysis: {}".format(", ".join(not_included)))
|
|
print("Parameters not included in this analysis: {}".format(", ".join(not_included)))
|
|
print("--------------------")
|
|
print("--------------------")
|
... | @@ -47,6 +58,10 @@ print("--------------------") |
... | @@ -47,6 +58,10 @@ print("--------------------") |
|
|
|
|
|
not_included = []
|
|
not_included = []
|
|
lalinference_attributes = dict(lalinf_samples.attrs)
|
|
lalinference_attributes = dict(lalinf_samples.attrs)
|
|
|
|
|
|
|
|
# PESummary called LAL_PNORDER: pn_order, so this changes the name of the attribute
|
|
|
|
PNORDER = lalinference_attributes.pop("LAL_PNORDER")
|
|
|
|
lalinference_attributes["pn_order"] = PNORDER
|
|
for attribute, value in lalinference_attributes.items():
|
|
for attribute, value in lalinference_attributes.items():
|
|
if not any(attribute in pesummary_attributes[key].keys() for key in pesummary_attributes.keys()):
|
|
if not any(attribute in pesummary_attributes[key].keys() for key in pesummary_attributes.keys()):
|
|
not_included.append(attribute)
|
|
not_included.append(attribute)
|
... | @@ -57,6 +72,7 @@ for attribute, value in lalinference_attributes.items(): |
... | @@ -57,6 +72,7 @@ for attribute, value in lalinference_attributes.items(): |
|
value = value.decode("utf-8")
|
|
value = value.decode("utf-8")
|
|
assert pesummary_attributes[key][attribute] == value, "{} != {} for the attribute {}".format(pesummary_attributes[key][attribute], value, attribute)
|
|
assert pesummary_attributes[key][attribute] == value, "{} != {} for the attribute {}".format(pesummary_attributes[key][attribute], value, attribute)
|
|
|
|
|
|
|
|
if len(not_included):
|
|
print("--------------------")
|
|
print("--------------------")
|
|
print("Parameters not included in this analysis: {}".format(", ".join(not_included)))
|
|
print("Parameters not included in this analysis: {}".format(", ".join(not_included)))
|
|
print("--------------------")
|
|
print("--------------------")
|
... | @@ -68,11 +84,10 @@ With output: |
... | @@ -68,11 +84,10 @@ With output: |
|
$ python runme.py
|
|
$ python runme.py
|
|
WARNING: failed to download https://datacenter.iers.org/data/9/finals2000A.all and ftp://cddis.gsfc.nasa.gov/pub/products/iers/finals2000A.all, using local IERS-B: db type is dbm.gnu, but the module is not available;db type is dbm.gnu, but the module is not available [astropy.utils.iers.iers]
|
|
WARNING: failed to download https://datacenter.iers.org/data/9/finals2000A.all and ftp://cddis.gsfc.nasa.gov/pub/products/iers/finals2000A.all, using local IERS-B: db type is dbm.gnu, but the module is not available;db type is dbm.gnu, but the module is not available [astropy.utils.iers.iers]
|
|
--------------------
|
|
--------------------
|
|
Parameters not included in this analysis: L1_cplx_snr_amp, L1_cplx_snr_arg, L1_optimal_snr, V1_cplx_snr_amp, V1_cplx_snr_arg, V1_optimal_snr, logL, logPrior
|
|
Parameters not included in this analysis: LAL_APPROXIMANT
|
|
--------------------
|
|
|
|
--------------------
|
|
|
|
Parameters not included in this analysis: LAL_APPROXIMANT, LAL_PNORDER
|
|
|
|
--------------------
|
|
--------------------
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Therefore all posterior samples that are in the LALInference result file are in the PESummary result file and they match perfectly. Likewise all but one attributes that are in the LALInference result file are in the PESummary result file and they match perfectly. The attribute `LAL_APPROXIMANT` stored in LALInference is not stored in PESummary because PESummary stores the name of the waveform and not the waveform enum. For reference, PESummary stores the waveform name as "IMRPhenomD_NRTidal" and LAL_APPROXIMANT is 73
|
|
|
|
|
|
# Reviewer comments |
|
# Reviewer comments |
|
|
|
\ No newline at end of file |