gwnrtools / nr-catalog-tools

A unified interface to various catalogs of Numerical Relativity simulations of compact binary mergers.
https://github.com/gwnrtools/nr-catalog-tools
GNU General Public License v3.0
1 stars 5 forks source link

Store simulation file paths in simulation metadata. #7

Closed vaishakp closed 1 year ago

vaishakp commented 1 year ago

It would be convenient to have the full path of the simulation metadata (used by the get_metadata method) and the file containing the modes data as an entry in the simulation metadata. It is recommended that this entry is set when the simulation metadata dictionary is created, and not computed again for the sake of consistency.

This would enable consistency checking between the H5 files and the simulation metadata loaded.

prayush commented 1 year ago

These paths are available as entries in the simulation metadata for the RIT catalog:

>>> from nrcatalogtools import RITCatalog
>>> rc = RITCatalog.load(verbosity=4, download=True)
..Going to read catalog file from cache.

>>> rc.get_metadata('RIT:BBH:0002-n100-id0')['metadata_location']
'/home/prayush/.cache/RIT/metadata/RIT:BBH:0002-n100-id0_Metadata.txt'

>>> rc.get_metadata('RIT:BBH:0002-n100-id0')['waveform_data_location']
'/home/prayush/.cache/RIT/data/ExtrapStrain_RIT-BBH-0002-n100.h5'

but not for GT and SXS catalogs at the moment. Is something like this what you're seeking for all catalogs?

prayush commented 1 year ago

Just pushed a patch that allows the same to be done fro the GT catalog:

>>> from nrcatalogtools import MayaCatalog
>>> gc = MayaCatalog.load(verbosity=4, download=True)
Downloading to /home/prayush/.cache/MAYA/catalog.temp.txt:
68.7kB [00:00, 43.4MB/s]

>>> gc.get_metadata('GT0003')['metadata_location']
'/home/prayush/.cache/MAYA/metadata/GT0003.txt'
>>> gc.get_metadata('GT0003')['waveform_data_location']
'/home/prayush/.cache/MAYA/data/GT0003.h5'
vaishakp commented 1 year ago

This looks good.

SXS stores the metadata path in its metadata under the name 'metadata_path'. Should we retain that?