redback.transient.afterglow.FluxToLuminosityConverter
- class redback.transient.afterglow.FluxToLuminosityConverter(redshift: float, photon_index: float, time: ndarray, time_err: ndarray, flux: ndarray, flux_err: ndarray, counts_to_flux_absorbed: float = 1.0, counts_to_flux_unabsorbed: float = 1.0, conversion_method: str = 'analytical')[source]
Bases:
object
- __init__(redshift: float, photon_index: float, time: ndarray, time_err: ndarray, flux: ndarray, flux_err: ndarray, counts_to_flux_absorbed: float = 1.0, counts_to_flux_unabsorbed: float = 1.0, conversion_method: str = 'analytical') None [source]
Flux to luminosity conversion class for the conversion behaviour in Afterglow. This class can be subclassed and passed into Afterglow if user specific conversion is desired.
- Parameters:
redshift (np.ndarray) – The redshift value to use.
photon_index (np.ndarray) – The photon index value to use.
time (np.ndarray) – Time data.
time_err (np.ndarray) – Time error data.
flux (np.ndarray) – Flux data.
flux_err (np.ndarray) – Flux error data.
counts_to_flux_absorbed (float) – Absorbed counts to flux ratio - a conversion of the count rate to flux.
counts_to_flux_unabsorbed (float) – Unabsorbed counts to flux ratio - a conversion of the count rate to flux.
conversion_method (str, optional) – The conversion method to use. Must be from FluxToLuminosityConverter.CONVERSION_METHODS
- __call__(**kwargs)
Call self as a function.
Methods
__init__
(redshift, photon_index, time, ...)Flux to luminosity conversion class for the conversion behaviour in Afterglow.
Calculates k-correction and converts the flux to luminosity.
get_isotropic_bolometric_flux
(k_corr)Calculates the isotropic bolometric flux given the k-correction
Calculates the k-correction depending on the conversion method.
Attributes
CONVERSION_METHODS
Fraction of counts_to_flux_absorbed to counts_to_flux_unabsorbed.
Luminosity distance given the redshift value.
- convert_flux_to_luminosity() tuple [source]
Calculates k-correction and converts the flux to luminosity.
- Returns:
The rest frame times and luminosities in the format (x, x_err, y, y_err).
- Return type:
tuple
- property counts_to_flux_fraction: float
Fraction of counts_to_flux_absorbed to counts_to_flux_unabsorbed.
- Returns:
The counts to flux fraction.
- Return type:
float
- get_isotropic_bolometric_flux(k_corr: float) float [source]
Calculates the isotropic bolometric flux given the k-correction
- Parameters:
k_corr (float) –
- get_k_correction() Optional[float] [source]
Calculates the k-correction depending on the conversion method. analytical: Use the redshift and the photon index. numerical: Call to sherpa package for the calculation.
- Returns:
The k-correction.
- Return type:
float
- property luminosity_distance: float
Luminosity distance given the redshift value.