lightcurvelynx.models.sncosmo_models
Wrappers for the models defined in sncosmo.
https://github.com/sncosmo/sncosmo/blob/v2.10.1/sncosmo/models.py https://sncosmo.readthedocs.io/en/stable/models.html
Classes
A wrapper for sncosmo models. |
Module Contents
- class SncosmoWrapperModel(source_name, node_label=None, wave_extrapolation=None, time_extrapolation=None, seed=None, **kwargs)[source]
Bases:
lightcurvelynx.models.physical_model.SEDModel,citation_compass.CiteClassA wrapper for sncosmo 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 sncosmo models.
References
sncosmo - https://zenodo.org/records/14714968
Individual models might require citation. See references in the sncosmo documentation.
- Parameters:
source_name (str) – The name used to set the source.
node_label (str, optional) – An identifier (or name) for the current node.
wave_extrapolation (FluxExtrapolationModel or tuple, optional) – The extrapolation model(s) to use for wavelengths that fall outside the model’s defined bounds. If a tuple is provided, then it is expected to be of the form (before_model, after_model) where before_model is the model for before the first valid wavelength and after_model is the model for after the last valid wavelength. If None is provided the model will not try to extrapolate, but rather call compute_sed() for all wavelengths.
time_extrapolation (FluxExtrapolationModel or tuple, optional) – The extrapolation model(s) to use for times that fall outside the model’s defined bounds. If a tuple is provided, then it is expected to be of the form (before_model, after_model) where before_model is the model for before the first valid time and after_model is the model for after the last valid time. If None is provided the model will not try to extrapolate, but rather call compute_sed() for all times.
seed (int, optional) – The seed for a random number generator.
**kwargs (dict, optional) – Any additional keyword arguments.
- minphase(**kwargs)[source]
Get the minimum phase of the model (in days relative to t0).
- Parameters:
**kwargs (dict) – Additional keyword arguments, not used in this method.
- Returns:
minphase – The minimum phase of the model (in days relative to t0) or None if the model does not have a defined minimum phase.
- Return type:
float or None
- maxphase(**kwargs)[source]
Get the maximum phase of the model (in days relative to t0).
- Parameters:
**kwargs (dict) – Additional keyword arguments, not used in this method.
- Returns:
maxphase – The maximum phase of the model (in days relative to t0) or None if the model does not have a defined maximum phase.
- Return type:
float or None
- minwave(**kwargs)[source]
Get the minimum wavelength of the model.
- Parameters:
**kwargs (dict) – Additional keyword arguments, not used in this method.
- 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(**kwargs)[source]
Get the maximum wavelength of the model.
- Parameters:
**kwargs (dict) – Additional keyword arguments, not used in this method.
- 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
- get(name)[source]
Get the value of a specific parameter.
- Parameters:
name (str) – The name of the parameter.
- Return type:
The parameter value.
- set(**kwargs)[source]
Set the parameters of the model.
These must all be constants to be compatible with sncosmo.
- Parameters:
**kwargs (dict) – The parameters to set and their values.
- 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.
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