PyART.catalogs.core¶
Attributes¶
Classes¶
Class for handling waveforms from the CoRe catalog. |
Functions¶
|
|
|
Given different datasets yi, i=1...N, collected as |
Module Contents¶
- class PyART.catalogs.core.Waveform_CoRe(path='../dat/CoRe/', ID='0001', run=None, code='BAM', kind='h5', mtdt_path=None, ell_emms='all', download=False, cut_at_mrg=False, cut_junk=None, nu_rescale=False, K=1)[source]¶
Bases:
PyART.waveform.Waveform
Class for handling waveforms from the CoRe catalog. See https://core-gitlab.tpi.uni-jena.de/core_database for more information. The data is downloaded via git clone. Make sure you have git-lfs installed.
- download_simulation(ID='BAM_0001', path='.', protocol='https', verbose=False)[source]¶
Download simulation from the CoRe database via git clone. Make sure you have git-lfs installed.
- Parameters:
ID (str, optional) – Simulation ID, e.g., ‘BAM_0001’. Default is ‘BAM_0001’.
path (str, optional) – Path to the directory where the simulation will be downloaded. Default is ‘.’.
protocol (str, optional) – Protocol to use for downloading. Options are ‘ssh’ or ‘https’. Default is ‘https’.
verbose (bool, optional) – If True, print out info for testing. Default is False. Default is False.
- Raises:
NameError – If the specified protocol is not supported.
- cut_at_mrg()[source]¶
Find the global peak of the 22 and cut the waveform at this time + 10 M. Assuming that this is the merger time. For some wfs with postmerger this might not be true!
- Raises:
NameError – If the 22 mode is not available.
- load_metadata(mtdt_path)[source]¶
Load metadata from the metadata_main.txt file. :param mtdt_path: Path to the metadata file. :type mtdt_path: str
- Returns:
metadata – Dictionary containing the metadata.
- Return type:
dict
- load_hlm(kind='h5', K=1)[source]¶
Load waveform modes from the specified format. If h5, extrapolate to infinity with a polynomial of order K. :param kind: Format of the waveform data. Options are ‘h5’ for HDF5 files or
‘txt’ for text files. Default is ‘h5’.
- Parameters:
K (int, optional) – Order of the polynomial used for extrapolating the waveform to infinite radius. Default is 1.
- Raises:
NameError – If the specified kind is not recognized.
- read_h_h5(basepath, K=1)[source]¶
Read modes from the h5 file. Extract both the modes at finite radius and extrapolate to infinity using a K=1 polynomial
- Parameters:
basepath (str) – Path to the directory containing the data.h5 file.
K (int, optional) – Order of the polynomial used for extrapolating the waveform to infinite radius. Default is 1.
- Raises:
FileNotFoundError – If the data.h5 file is not found.
- PyART.catalogs.core.radius_extrap_polynomial(ys, rs, K)[source]¶
- Given different datasets yi, i=1…N, collected as
ys = [y0, y1, y2, … , yN]
- and array containing extraction radii
rs = [r0, r1, r2, … , rN],
compute the asymptotic value of y as r goes to infinity from an Kth order polynomial in 1/r, e.g.
yi = y_infty + \sum_i=k^K ci / ri^k,
where y_infty and the K coefficients ci are determined through a least squares polynomial fit from the above data.
- Parameters:
ys (list of arrays) – Collection of data sets yi which all are of the same length, e.g. all sampled on the same grid u.
rs (list of floats) – Extraction radii of the data samples yi
K (int) – Maximum polynomial order of 1/r polynomial
- Returns:
yinfty – Extrapolated data set at r -> infinity
- Return type:
array