lightcurvelynx.models.redback_models
Wrappers for the models defined in redback.
https://github.com/nikhil-sarin/redback https://redback.readthedocs.io/en/latest/
Classes
A wrapper for redback models. |
Module Contents
- class RedbackWrapperModel(source, *, priors=None, parameters=None, **kwargs)[source]
Bases:
lightcurvelynx.models.physical_model.SEDModel,citation_compass.CiteClassA wrapper for redback models.
Parameterized values include:
dec - The object’s declination in degrees. [from BasePhysicalModel]
distance - The object’s luminosity distance in pc. [from BasePhysicalModel]
ra - The object’s right ascension in degrees. [from BasePhysicalModel]
redshift - The object’s redshift. [from BasePhysicalModel]
t0 - The t0 of the zero phase, date. [from BasePhysicalModel]
Additional parameterized values are used for specific redback models.
References
redback - https://ui.adsabs.harvard.edu/abs/2024MNRAS.531.1203S/abstract
Individual models might require citation. See references in the redback documentation.
- source
The underlying source function that maps time + wavelength to flux.
- Type:
function
- source_name
The name used to set the source.
- Type:
str
- Parameters:
source (str or function) – The name of the redback model function used to generate the SEDs or the actual function itself.
priors (dict, bilby.prior.PriorDict, or BilbyPriorNode, optional) – The redback model’s Bilby priors.
parameters (dict, optional) – A dictionary of parameter setters to pass to the source function.
**kwargs (dict, optional) – Any additional keyword arguments.
Note
You can automatically extract the priors for a model (in the correct format) using redback’s get_priors() function and passing the name of the model as the model argument: priors = get_priors(model=”one_component_kilonova_model”)
- minwave(graph_state=None)[source]
Get the minimum wavelength of the model.
- Parameters:
graph_state (GraphState, optional) – An object mapping graph parameters to their values. Not used for this model.
- Returns:
minwave – The minimum wavelength of the model (in angstroms) or None if the model does not have a defined minimum wavelength.
- Return type:
float or None
- maxwave(graph_state=None)[source]
Get the maximum wavelength of the model.
- Parameters:
graph_state (GraphState, optional) – An object mapping graph parameters to their values. Not used for this model.
- Returns:
maxwave – The maximum wavelength of the model (in angstroms) or None if the model does not have a defined maximum wavelength.
- Return type:
float or None
- minphase(**kwargs)[source]
Get the minimum supported phase of the model in days.
- Parameters:
**kwargs (dict) – Additional keyword arguments, not used in this method.
- Returns:
minphase – The minimum phase of the model (in days) or None if the model does not have a defined minimum phase.
- Return type:
float or None
- maxphase(**kwargs)[source]
Get the maximum supported phase of the model in days.
- Parameters:
**kwargs (dict) – Additional keyword arguments, not used in this method.
- Returns:
maximum – The maximum phase of the model (in days) or None if the model does not have a defined maximum phase.
- Return type:
float or None
- compute_sed_with_extrapolation(times, wavelengths, graph_state, **kwargs)[source]
Draw effect-free observations for this object, extrapolating to times and wavelengths where the model is not defined.
We override this method because the extrapolation bounds will depend on the materialized RedbackTimeSeriesSource object, so we need to do the precomputation to get that object. We will cache the object so we don’t perform the computation twice.
- Parameters:
times (numpy.ndarray) – A length T array of rest frame timestamps.
wavelengths (numpy.ndarray, optional) – A length N array of wavelengths (in angstroms).
graph_state (GraphState) – An object mapping graph parameters to their values.
**kwargs (dict, optional) – Any additional keyword arguments.
- Returns:
flux_density – A length T x N matrix of SED values (in nJy).
- Return type:
numpy.ndarray
- compute_sed(times, wavelengths, graph_state=None, **kwargs)[source]
Draw effect-free observations for this object.
- Parameters:
times (numpy.ndarray) – A length T array of rest frame timestamps (MJD).
wavelengths (numpy.ndarray, optional) – A length N array of wavelengths (in angstroms).
graph_state (GraphState) – An object mapping graph parameters to their values.
**kwargs (dict, optional) – Any additional keyword arguments.
- Returns:
flux_density – A length T x N matrix of SED values (in nJy).
- Return type:
numpy.ndarray