... | @@ -68,6 +68,37 @@ np.testing.assert_almost_equal(pesummary_viewing_angle, reviewed_viewing_angle) |
... | @@ -68,6 +68,37 @@ np.testing.assert_almost_equal(pesummary_viewing_angle, reviewed_viewing_angle) |
|
|
|
|
|
# `summaryextract`
|
|
# `summaryextract`
|
|
|
|
|
|
|
|
## Review tasks
|
|
|
|
|
|
|
|
To test the `summaryextract` executable we extracted the `PublicationSamples` posterior samples from the public GW190814.h5 file and compared the contents with the original file. We ran the following:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
summaryextract --outdir ./ --samples GW190814.h5 --filename extracted_PublicationSamples.dat --file_format dat --label PublicationSamples
|
|
|
|
```
|
|
|
|
|
|
|
|
And compared the contents with:
|
|
|
|
|
|
|
|
```python
|
|
|
|
import h5py
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
original = h5py.File("GW190814.h5", "r")
|
|
|
|
original_PublicationSamples = original["PublicationSamples"]["posterior_samples"]
|
|
|
|
extracted = np.genfromtxt("extracted_PublicationSamples.dat", names=True)
|
|
|
|
assert all(param in extracted.dtype.names for param in original_PublicationSamples.dtype.names)
|
|
|
|
for param in original_PublicationSamples.dtype.names:
|
|
|
|
|
|
|
|
np.testing.assert_almost_equal(original_PublicationSamples[param], extracted[param])
|
|
|
|
```
|
|
|
|
|
|
|
|
with output:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
As you can see the extracted samples match the original.
|
|
|
|
|
|
## Related MRs
|
|
## Related MRs
|
|
|
|
|
|
* https://git.ligo.org/lscsoft/pesummary/-/merge_requests/519
|
|
* https://git.ligo.org/lscsoft/pesummary/-/merge_requests/519
|
... | | ... | |