PyART.catalogs.core

Attributes

Classes

Waveform_CoRe

Class for handling waveforms from the CoRe catalog.

Functions

vector_string_to_array(vstr)

radius_extrap_polynomial(ys, rs, K)

Given different datasets yi, i=1...N, collected as

Module Contents

PyART.catalogs.core.conversion_dict_floats[source]
PyART.catalogs.core.conversion_dict_vectors[source]
PyART.catalogs.core.vector_string_to_array(vstr)[source]
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.

ID = 'BAM_0001'[source]
run = None[source]
ell_emms = 'all'[source]
core_data_path[source]
metadata = None[source]
domain = 'Time'[source]
nu_rescale = False[source]
simpath[source]
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.

read_h_txt(basepath)[source]

Read modes from the txt files. :param basepath: Path to the directory containing the txt files. :type basepath: str

Raises:

FileNotFoundError – If no txt files are found in the specified directory.

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