lightcurvelynx.astro_utils.redshift
Utility functions for handling redshift and cosmological calculations.
Classes
A wrapper class for the redshift_to_distance() function. |
Functions
|
Calculate the rest frame times and wavelengths needed to give user the observer frame times |
|
Convert rest-frame flux to obs-frame flux. |
|
Compute a source's luminosity distance given its redshift and a |
Module Contents
- obs_to_rest_times_waves(observer_frame_times, observer_frame_wavelengths, redshift, t0)[source]
Calculate the rest frame times and wavelengths needed to give user the observer frame times and wavelengths (given the redshift).
- Parameters:
observer_frame_times (numpy.ndarray) – The times at which the observation is made.
observer_frame_wavelengths (numpy.ndarray) – The wavelengths at which the observation is made (in Angstroms).
redshift (float) – The redshift of the object.
t0 (float) – The reference epoch for the given object.
- Returns:
The rest frame times and wavelengths needed to generate the rest frame flux densities, which will later be redshifted back to observer frame flux densities at the observer frame times and wavelengths.
- Return type:
tuple of (numpy.ndarray, numpy.ndarray)
- rest_to_obs_flux(flux_density, redshift)[source]
Convert rest-frame flux to obs-frame flux. The (1+redshift) factor is applied to preserve bolometric flux. The rest-frame flux is defined as
F_nu = L_nu / 4*pi*D_L**2, whereD_Lis the luminosity distance.- Parameters:
flux_density (numpy.ndarray) – A length T X N matrix of flux density values (in nJy).
redshift (float) – The redshift of the object associated with given flux densities.
- Returns:
flux_density – The observer frame flux (in nJy).
- Return type:
numpy.ndarray
- redshift_to_distance(redshift, cosmology)[source]
Compute a source’s luminosity distance given its redshift and a specified cosmology using astropy’s redshift_distance().
- Parameters:
redshift (float or numpy.ndarray) – The redshift value.
cosmology (astropy.cosmology) – The cosmology specification.
- Returns:
distance – The luminosity distance (in pc)
- Return type:
float
- class RedshiftDistFunc(redshift, cosmology, **kwargs)[source]
Bases:
lightcurvelynx.base_models.FunctionNodeA wrapper class for the redshift_to_distance() function.
- cosmology
The cosmology specification.
- Type:
astropy.cosmology
- Parameters:
redshift (function or constant) – The function or constant providing the redshift value.
cosmology (astropy.cosmology) – The cosmology specification.
**kwargs (dict, optional) – Any additional keyword arguments.