simulations

Attributes

Classes

geom

Geometric units + Msun = 1

cgs

CGS units

metric

Standard SI units

Simulations

Class representing simulation data

Functions

runcmd(cmd, workdir[, out])

Execute cmd in workdir

adm_to_eob(q_vec, p_vec, nu)

Convert q_ADM, p_ADM to EOB, 2PN trafo.

polar_to_cartesian(q_p, p_p)

q_p : [r , phi ]

cartesian_to_polar(q_c, p_c)

q_c : [x , y ]

Module Contents

simulations.ufact[source]
class simulations.geom[source]

Geometric units + Msun = 1

grav_constant = 1.0[source]
light_speed = 1.0[source]
solar_mass = 1.0[source]
MeV = 1.0[source]
class simulations.cgs[source]

CGS units

grav_constant = 6.673e-08[source]
light_speed = 29979245800.0[source]
solar_mass = 1.9884099021470417e+33[source]
MeV = 11604505000.0[source]
class simulations.metric[source]

Standard SI units

grav_constant = 6.673e-11[source]
light_speed = 299792458.0[source]
solar_mass = 1.9884099021470415e+30[source]
MeV = 11604505000.0[source]
simulations.runcmd(cmd, workdir, out=None)[source]

Execute cmd in workdir

simulations.adm_to_eob(q_vec, p_vec, nu)[source]

Convert q_ADM, p_ADM to EOB, 2PN trafo. (E18) and (E19) of https://arxiv.org/pdf/1210.2834.pdf

q_vec: ADM puncture relative distance, x_p - x_m, cartesian p_vec: ADM puncture relative linear momentum, p_p, cartesian, nu-normalized nu : symmetric mass ratio

simulations.polar_to_cartesian(q_p, p_p)[source]

q_p : [r , phi ] p_p : [pr, pphi]

simulations.cartesian_to_polar(q_c, p_c)[source]

q_c : [x , y ] p_c : [px, py]

simulations.COMMENTS_IGNORE = ['#'][source]
simulations.METADATA_EXTENSION = ['.txt', '.json'][source]
simulations.KEYMAP[source]
class simulations.Simulations(path='./', metadata_ext=METADATA_EXTENSION, comments_ignore=COMMENTS_IGNORE, keymap=KEYMAP, sxs_unpack=True, rit_ids_unpack=False)[source]

Class representing simulation data

pathpath to the metadata

search is recursive from this level

metadata_ext : extension(s) of metadata files

comments_ignore : list of characters to ignore

keymap : dictionary to map key names

path = './'[source]
files[source]
comments_ignore = ['#'][source]
data = [][source]
info()[source]
read_txt(fname)[source]

Read metadata from a txt file

read_json(fname)[source]

Read metadata from a json file

sxs_json_extract_append(db, catalog, f)[source]

Special method to extract single-simulation metadata from sxs_catalog.json and append those

rit_tex_read_punctures_id(fname)[source]

Special method to read punctures ID in ADM coordinates from rit_id_table.txt

Headers: Run, x_1/m, x_2/m, P_r/m, P_t/m, m^p_1/m, m^p_2/m, |S_1/m^2|, |S_2/m^2|, m^H_1/m, m^H_2/m, M_{

m ADM}/m,|a_1/m_1^H|,|a_2/m_2^H|

or Run, x_1/m, x_2/m, P_r/m, P_t/m, m^p_1/m, m^p_2/m, m^H_1/m, m^H_2/m, M_{

m ADM}/m, e, N_{orb}

rit_extract_punctures_id(db, id_db)[source]

Special method to extract punctures ID in ADM coordinates from id_db and add it to simulation

parse_metadata(keymap=KEYMAP)[source]

Parse metadata dictionary For basic quantities: * add keys with uniform names across catalogs * make sure necessary data are present

cast_to_float(x, ReturnLast=True)[source]
remove_empty_vals()[source]
search(key, val, bound=0.0)[source]

Return list of simulations matching a particular key-value pair

q_to_nu(q)[source]
ADM_to_EOB(nu, q_adm, p_adm, polar=False)[source]

Transform the initial conditions q_adm, p_adm to EOB coordinates.

www_get_RIT(simulation)[source]

Return command to get RIT data from www

RIT catalog offers 3 type of files, names are based on a few metadata entries

Example:

catalog-tag = RIT:BBH:0001 resolution-tag = n100 id-tag = id3

‘Metadata/RIT:BBH:0001-n100-id3_Metadata.txt’ ‘Data/ExtrapPsi4_RIT-BBH-0001-n100-id3.tar.gz ‘Data/ExtrapStrain_RIT-BBH-0001-n100.h5’

Note: Currently relies on the system call ‘wget’. There python packages (see below), but would need installation. What is available within anaconda?

www_get_SXS(simulation)[source]

Return command to get SXS data from www

TODO SXS metadata contains a ‘url’ key to Zenodo can use wget, curl or the various pyton-based packages: https://pypi.org/project/requests/ https://pypi.org/project/zenodo-get/

www_get(data=None, outdir='Data/', dryrun=False)[source]

Get data corresponding to the input metadata Websites and www get are set based on the CATALOG key Outdir is pre-pended by path and CATALOG

simulations.s[source]