Skip to content

API for the jaxqualin.data module

download_file(filepath, url, overwrite='update')

Downloads a file from a url to a filepath

Parameters:

Name Type Description Default
filepath str

The filepath to save the downloaded file to

required
url str

The url to download the file from

required
overwrite str

Whether to overwrite the file if it already exists. Can be one of 'force', 'update', or 'never'.

'update'

last_modified_time(url)

Returns the last modified time of a url

Parameters:

Name Type Description Default
url str

The url to check the last modified time of

required

Returns:

Type Description
struct_time

The last modified time of the url as a time.struct_time object

make_hyper_fit_functions(filepath=_default_hyperfit_data_path, PN=True)

Make a dictionary of hyperfit functions from a hyperfit data file.

Parameters:

Name Type Description Default
filepath str

The filepath of the hyperfit data file.

_default_hyperfit_data_path
PN bool

Whether to use Post Newtonian variables (eta, chi_p, chi_m) or the natural parameterization of the BBH simulations (q, chi_1, chi_2).

True

Returns:

Type Description
Dict[str, Dict[str, Callable[[float, float, float], float]]]

A dictionary of hyperfit functions. The keys are the mode names, and the values are dictionaries with keys A and phi for the amplitude and phase hyperfit functions, respectively.

make_interpolators(filepath=_default_interpolate_data_path, PN=True)

Make a dictionary of interpolators from a data file containing the extracted amplitude and phases of different modes from BBH simulations.

Parameters:

Name Type Description Default
filepath str

The filepath of the data file.

_default_interpolate_data_path
PN bool

Whether to use Post Newtonian variables (eta, chi_p, chi_m) or the natural parameterization of the BBH simulations (q, chi_1, chi_2).

True

Returns:

Type Description
Dict[str, Dict[str, LinearNDInterpolator]]

A dictionary of interpolators. The keys are the mode names, and the values are dictionaries with keys A, dA, phi, and dphi for the amplitude, amplitude fluctuation, phase, and phase fluctuation interpolators, respectively.