... | ... | @@ -33,10 +33,26 @@ for param in pesummary_samples.keys(): |
|
|
|
|
|
# Check posterior samples
|
|
|
not_included = []
|
|
|
for param in ["l_peak_nonevol", "af_nonevol", "mf_nonevol"]:
|
|
|
if param in pesummary_dict.keys():
|
|
|
for param in ["l_peak_nonevol", "af_nonevol", "mf_nonevol", "e_rad_nonevol"]:
|
|
|
if param in pesummary_dict.keys() and param != "e_rad_nonevol":
|
|
|
comparison = np.round(pesummary_dict[param], 8) == np.round(lalinf_samples[param], 8)
|
|
|
assert all(i == True for i in comparison)
|
|
|
difference = pesummary_dict[param] - lalinf_samples[param]
|
|
|
print(
|
|
|
"Maximum difference for {}: {}".format(
|
|
|
param, np.max(np.abs(difference))
|
|
|
)
|
|
|
)
|
|
|
elif param == "e_rad_nonevol":
|
|
|
corrected_lalinf = lalinf_samples[param] * (pesummary_dict["m1_source"] / lalinf_samples["m1_source"])
|
|
|
comparison = np.round(pesummary_dict[param], 8) == np.round(corrected_lalinf, 8)
|
|
|
assert all(i == True for i in comparison)
|
|
|
difference = pesummary_dict[param] - corrected_lalinf
|
|
|
print(
|
|
|
"Maximum difference for {}: {}".format(
|
|
|
param, np.max(np.abs(difference))
|
|
|
)
|
|
|
)
|
|
|
else:
|
|
|
not_included.append(param)
|
|
|
|
... | ... | @@ -46,6 +62,16 @@ if len(not_included): |
|
|
print("--------------------")
|
|
|
```
|
|
|
|
|
|
With output:
|
|
|
|
|
|
```bash
|
|
|
$ python compare_output.py
|
|
|
Maximum difference for l_peak_nonevol: 1.0045297926808416e-12
|
|
|
Maximum difference for af_nonevol: 1.3800072196090696e-13
|
|
|
Maximum difference for mf_nonevol: 7.958078640513122e-13
|
|
|
Maximum difference for e_rad_nonevol: 4.1033842990145786e-13
|
|
|
```
|
|
|
|
|
|
# Review comments
|
|
|
|
|
|
## David Keitel 20200304
|
... | ... | |