To obtain the data to run this tutorial, download the tar.gz file from https://zenodo.org/records/10668525 and unzip it. Then run the creating_h5 tutorial to create a .h5 file to use with this tutorial. Then set example_h5_filepath to be the path to that .h5 file.

Once you have run the tutorial on the sample simulation, you can also try downloading a file from the MAYA catalog in the MAYA format (https://cgp.ph.utexas.edu/waveform) and using it with the tutorial.

Exporting to LVK Catalog Format

[1]:
from mayawaves.coalescence import Coalescence
from mayawaves.utils.postprocessingutils import export_to_lvcnr_catalog, export_to_lal_compatible_format

Create a Coalescence object using the simulation h5 file

[2]:
example_h5_filepath = "D11_q5_a1_-0.362_-0.0548_-0.64_a2_-0.0013_0.001_-0.0838_m533.33.h5"
output_direcory = ""
[3]:
coalescence = Coalescence(example_h5_filepath)

Export to the LVC NR catalog format

Exporting to this format requires extrapolating the waveforms to infinite radius.

The exported file will have the same name as the initial simulation h5 file.

[4]:
export_to_lvcnr_catalog(coalescence, output_direcory, NR_group='UT Austin', NR_code='MAYA', bibtex_keys='Jani:2016wkt', contact_email='email@email.com')
This simulation is not part of a catalog and does not have a catalog id.
Storing (l, m)=(2, -2)
Storing (l, m)=(2, -1)
Storing (l, m)=(2, 0)
Storing (l, m)=(2, 1)
Storing (l, m)=(2, 2)
Storing (l, m)=(3, -3)
Storing (l, m)=(3, -2)
Storing (l, m)=(3, -1)
Storing (l, m)=(3, 0)
Storing (l, m)=(3, 1)
Storing (l, m)=(3, 2)
Storing (l, m)=(3, 3)
Storing (l, m)=(4, -4)
Storing (l, m)=(4, -3)
Storing (l, m)=(4, -2)
Storing (l, m)=(4, -1)
Storing (l, m)=(4, 0)
Storing (l, m)=(4, 1)
Storing (l, m)=(4, 2)
Storing (l, m)=(4, 3)
Storing (l, m)=(4, 4)

An optional name can be provided which will be used as the name of the exported file

[5]:
export_to_lvcnr_catalog(coalescence, output_direcory, name='SIM0001', NR_group='UT Austin', NR_code='MAYA', bibtex_keys='Jani:2016wkt', contact_email='email@email.com')
This simulation is not part of a catalog and does not have a catalog id.
Storing (l, m)=(2, -2)
Storing (l, m)=(2, -1)
Storing (l, m)=(2, 0)
Storing (l, m)=(2, 1)
Storing (l, m)=(2, 2)
Storing (l, m)=(3, -3)
Storing (l, m)=(3, -2)
Storing (l, m)=(3, -1)
Storing (l, m)=(3, 0)
Storing (l, m)=(3, 1)
Storing (l, m)=(3, 2)
Storing (l, m)=(3, 3)
Storing (l, m)=(4, -4)
Storing (l, m)=(4, -3)
Storing (l, m)=(4, -2)
Storing (l, m)=(4, -1)
Storing (l, m)=(4, 0)
Storing (l, m)=(4, 1)
Storing (l, m)=(4, 2)
Storing (l, m)=(4, 3)
Storing (l, m)=(4, 4)

You can optionally correct for the center of mass drift before exporting

[6]:
export_to_lvcnr_catalog(coalescence, output_direcory, center_of_mass_correction=True, NR_group='UT Austin', NR_code='MAYA', bibtex_keys='Jani:2016wkt', contact_email='email@email.com')
This simulation is not part of a catalog and does not have a catalog id.
Storing (l, m)=(2, -2)
Storing (l, m)=(2, -1)
Storing (l, m)=(2, 0)
Storing (l, m)=(2, 1)
Storing (l, m)=(2, 2)
Storing (l, m)=(3, -3)
Storing (l, m)=(3, -2)
Storing (l, m)=(3, -1)
Storing (l, m)=(3, 0)
Storing (l, m)=(3, 1)
Storing (l, m)=(3, 2)
Storing (l, m)=(3, 3)
Storing (l, m)=(4, -4)
Storing (l, m)=(4, -3)
Storing (l, m)=(4, -2)
Storing (l, m)=(4, -1)
Storing (l, m)=(4, 0)
Storing (l, m)=(4, 1)
Storing (l, m)=(4, 2)
Storing (l, m)=(4, 3)
Storing (l, m)=(4, 4)

Export to LAL Compatible format

This format lets you use the waveform with LALSimulation and PyCBC. It is of the same format as the LVC NR catalog but allows you to specify a finite extraction radius if so desired.

[7]:
export_to_lal_compatible_format(coalescence, output_direcory, extraction_radius=75, NR_group='UT Austin', NR_code='MAYA', bibtex_keys='Jani:2016wkt', contact_email='email@email.com')
Storing (l, m)=(2, -2)
Storing (l, m)=(2, -1)
Storing (l, m)=(2, 0)
Storing (l, m)=(2, 1)
Storing (l, m)=(2, 2)
Storing (l, m)=(3, -3)
Storing (l, m)=(3, -2)
Storing (l, m)=(3, -1)
Storing (l, m)=(3, 0)
Storing (l, m)=(3, 1)
Storing (l, m)=(3, 2)
Storing (l, m)=(3, 3)
Storing (l, m)=(4, -4)
Storing (l, m)=(4, -3)
Storing (l, m)=(4, -2)
Storing (l, m)=(4, -1)
Storing (l, m)=(4, 0)
Storing (l, m)=(4, 1)
Storing (l, m)=(4, 2)
Storing (l, m)=(4, 3)
Storing (l, m)=(4, 4)

Close the Coalescence object to close the associated h5 file

[8]:
coalescence.close()
[ ]: