Update v0.13.0 authored by Charlie Hoy's avatar Charlie Hoy
[[_TOC_]]
# `summaryreview` script
* output from running `summaryreview` can be seen here: https://ldas-jobs.ligo.caltech.edu/~charlie.hoy/projects/pesummary_review/v0.13.0/cbcBayesPostProc/home.html
## Related MRs
## Reviewer comments
# Reweight to uniform in comoving volume prior
## Related MRs
* https://git.ligo.org/lscsoft/pesummary/-/merge_requests/596
## Example outputs
* [summary page](https://ldas-jobs.ligo.caltech.edu/~charlie.hoy/projects/pesummary/comoving/pesummary_reweight/home.html)
## Review tasks
I checked that the reweighted samples output by PESummary are equal to those output from the reviewed [`resample_uniform_comoving.py`](https://git.ligo.org/pe/O3/o3a_catalog_events/-/blob/master/scripts/resample_uniform_comoving.py) (used in the GWTC-2 catalog) when ran on the same publically available posterior samples (`GW190408_181802`). In order to remove any differences caused by the `numpy.random` package, I made a small edit to `resample_uniform_comoving.py` to force both scripts to use the same random seed. The diff can be seen below:
```
$ diff /home/john.veitch/o3a_catalog_events/scripts/resample_uniform_comoving.py resample_uniform_comoving.py
12a13
> np.random.seed(123456789)
```
I then ran the following command line to generate a set of samples using the `resample_uniform_comoving.py` script:
```bash
python ./resample_uniform_comoving.py ./GW190408_181802/GW190408_181802.h5 GW190408_181802/GW190408_181802_comoving_using_existing_script.h5 --runid PublicationSamples
```
and ran the following command line to generate a set of samples using `pesummary`:
```bash
summarypages --no_ligo_skymap --cosmology Planck15_lal --webdir /home/charlie.hoy/public_html/projects/pesummary/comoving/pesummary_reweight --samples GW190408_181802/GW190408_181802.h5 --gw --reweight_samples uniform_in_comoving_volume --multi_process 4 --disable_corner --disable_interactive --compare_results PublicationSamples
```
I then compared the samples with the following script:
```
import h5py
import numpy as np
original = h5py.File(
"./GW190408_181802/GW190408_181802_comoving_using_existing_script.h5", "r"
)["PublicationSamples"]["posterior_samples"]
pesummary = h5py.File(
(
"/home/charlie.hoy/public_html/projects/pesummary/comoving/"
"pesummary_reweight/samples/posterior_samples.h5"
), "r"
)["PublicationSamples"]["posterior_samples"]
for param in original.dtype.names:
np.testing.assert_almost_equal(original[param], pesummary[param])
```
And no AssertionError's were raised. All tests were ran from the following directory at CIT:`/home/charlie.hoy/projects/pesummary/comoving`.
## Reviewer comments
04/08/2021 - 07.19 @philip.relton
- I have run the same comparison and got the same result. No AssertionErrors.
- Approved
\ No newline at end of file