lightcurvelynx.models.bagle_models
Wrappers for the models defined in bagle.
https://github.com/MovingUniverseLab/BAGLE_Microlensing
Classes
A wrapper for single bagle models (one model type). |
|
A wrapper for multiple bagle models (multiple model types). |
Module Contents
- class BagleWrapperModel(model_info, parameter_dict, filter_idx=None, **kwargs)[source]
Bases:
lightcurvelynx.models.physical_model.BandfluxModel,citation_compass.CiteClassA wrapper for single bagle models (one model type).
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 bagle models.
Note
The t0 parameter saved in the results may be approximate depending on the bagle model used. Some models compute t0 from other parameters (e.g., time of closest approach). This updated t0 is not saved in the results.
References
Lu et al., “The BAGLE Python Package for Bayesian Analysis of Gravitational Lensing Events”, AAS Journals, submitted
Bhadra et al., “Modeling Binary Lenses and Sources with the BAGLE Python Package”, AAS Journals, submitted
Chen et al., “Adjusting Gaussian Process Priors for BAGLE’s Gravitational Microlensing Model Fits”, in prep.
- Parameters:
model_info (str or class) – The name of the bagle model class to use in the simulation or the class itself.
parameter_dict (dict) – A dictionary of parameter names and values to use for the model. The keys should match the parameter names expected by the bagle model.
filter_idx (dict, optional) – A mapping from filter names to indices expected by the bagle model. If not provided, a default mapping for ugrizy filters to [0, 1, 2, 3, 4, 5] will be used.
**kwargs (dict, optional) – Any additional keyword arguments.
- compute_bandflux(times, filter, state)[source]
Evaluate the model at the passband level for a single, given graph state and filter.
- Parameters:
times (numpy.ndarray) – A length T array of observer frame timestamps in MJD.
filter (str) – The name of the filter.
state (GraphState) – An object mapping graph parameters to their values with num_samples=1. This is not used in this model, but is required for the function signature.
- Returns:
bandflux – A length T array of band fluxes for this model in this filter.
- Return type:
numpy.ndarray
- class BagleMultiWrapperModel(models, parameter_dicts, filter_idx=None, in_order=False, **kwargs)[source]
Bases:
lightcurvelynx.models.physical_model.BandfluxModel,citation_compass.CiteClassA wrapper for multiple bagle models (multiple model types).
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 bagle models.
References
Lu et al., “The BAGLE Python Package for Bayesian Analysis of Gravitational Lensing Events”, AAS Journals, submitted
Bhadra et al., “Modeling Binary Lenses and Sources with the BAGLE Python Package”, AAS Journals, submitted
Chen et al., “Adjusting Gaussian Process Priors for BAGLE’s Gravitational Microlensing Model Fits”, in prep.
- parameter_dicts[source]
A list of parameter dictionaries, one per model, each containing the parameter names and values for use in the corresponding model.
- Type:
dict
- Parameters:
models (list of str or class) – The bagle model classes (or their names as strings) to use in the simulation.
parameter_dicts (dict) – A list of parameter dictionaries, one per model, each containing the parameter names and values for use in the corresponding model.
filter_idx (dict, optional) – A mapping from filter names to indices expected by the bagle model. If not provided, a default mapping for ugrizy filters to [0, 1, 2, 3, 4, 5] will be used.
in_order (bool) – Return the given data in order of the rows (True). If False, performs random sampling with replacement. Default: False
**kwargs (dict, optional) – Any additional keyword arguments.
- compute_bandflux(times, filter, state)[source]
Evaluate the model at the passband level for a single, given graph state and filter.
- Parameters:
times (numpy.ndarray) – A length T array of observer frame timestamps in MJD.
filter (str) – The name of the filter.
state (GraphState) – An object mapping graph parameters to their values with num_samples=1. This is not used in this model, but is required for the function signature.
- Returns:
bandflux – A length T array of band fluxes for this model in this filter.
- Return type:
numpy.ndarray