fruitbat.utils¶
Utility functions for Fruitbat
-
fruitbat.utils.
create_lookup_table
(filename, method, cosmology, zmin=0, zmax=30, num_samples=100000.0)[source]¶ Creates a lookup table
Parameters: - filename (str) –
- method (str) –
- cosmology (dict) – A dictionary containing the cosmology parameters for the Hubble
constant, Matter density, Baryon density and Dark Energy density.
cosmology must contain values for the following keys:
'H0'
,'Omega_m'
,'Omega_b'
,'Omega_L'
- zmin (int or float, optional) – The minimum redshift in the table. Default: 0
- zmax (int or float, optional) – The maximum redshift in the table. Default: 30
- num_samples (int, optional) – The number of dispersion measure samples to perform before interpolation. Default: 100000
Returns: Return type: None
-
fruitbat.utils.
load_lookup_table
(filename, data_dir='data')[source]¶ Opens a saved .npy file containing an interpolated 1D function.
Parameters: - filename (str) – The name of the file to load.
- data_dir (str, optional) – The directory containing the data. The whole path must be specified
except if
data_dir
== ‘data’ then it will search in the data subdirectory of the source code. Default: ‘data’
Returns: Function
Return type: scipy.interpolate.interpolate.interp1d