lightcurvelynx.models.pylima_models

Wrappers for the models defined in pyLIMA.

https://github.com/ebachelet/pyLIMA

Classes

PyLIMAWrapperModel

A wrapper for single pyLIMA models (one model type).

Module Contents

class PyLIMAWrapperModel(model_info, source_mags, *, blend_mags=None, pylima_params=None, parallax_model='None', blend_flux_parameter='fblend', time_frame_offset=MJD_TO_JD_OFFSET, observer_location='Earth', **kwargs)[source]

Bases: lightcurvelynx.models.physical_model.BandfluxModel, citation_compass.CiteClass

A wrapper for single pyLIMA 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 PyLIMA models.

Parameters:
  • model_info (str or class) – The name of the pyLIMA model class to use in the simulation or the class itself.

  • source_mags (dict) – A mapping from filter names to source magnitudes for the microlensed source.

  • blend_mags (dict, optional) – A mapping from filter names to blending magnitudes for the microlensed source.

  • pylima_model_params (dict, optional) – A dictionary of additional pyLIMA parameters for the model, such as ‘u0’, ‘tE’, ‘rho’, etc. If a parameter is already added to the model, its value will be updated instead.

  • parallax_model (str, optional) – The pyLIMA parallax model type: ‘None’, ‘Annual’, ‘Terrestrial’, or ‘Full’. The times for the parallax are automatically set during the evaluation.

  • blend_flux_parameter (str, optional) – The pyLIMA blend flux parameter type. Currently only ‘fblend’ is supported. See also https://github.com/lincc-frameworks/lightcurvelynx/issues/691

  • time_frame_offset (float, optional) – PyLIMA models use JD for time while users may specify any time system. This offset is added to the input times to convert them to JD. By default, this is set to MJD_TO_JD_OFFSET to convert from MJD to JD.

  • observer_location (str, optional) – The location of the observer. Default is ‘Earth’.

  • **kwargs (dict, optional) – Any additional keyword arguments.

filters[source]

The list of filters supported by this model.

Type:

list

parallax_model[source]

The pyLIMA parallax model type: ‘None’, ‘Annual’, ‘Terrestrial’, or ‘Full’.

Type:

str, optional

blend_flux_parameter[source]

The pyLIMA blend flux parameter type. Currently only ‘fblend’ is supported. See also https://github.com/lincc-frameworks/lightcurvelynx/issues/691

Type:

str, optional

time_frame_offset[source]

PyLIMA models use JD for time while users may specify any time system. This offset is added to the input times to convert them to JD.

Type:

float, optional

observer_location[source]

The location of the observer.

Type:

str, optional

time_frame_offset = 2400000.5[source]
observer_location = 'Earth'[source]
parallax_model = 'None'[source]
blend_flux_parameter = 'fblend'[source]
filters[source]
make_pylima_event(ra, dec, filter=None, times=None)[source]

Create a pyLIMA event object and attach a telescope if filter and times are given.

Parameters:
  • ra (float) – The right ascension of the event in degrees.

  • dec (float) – The declination of the event in degrees.

  • filter (str, optional) – The name of the filter for the telescope to attach.

  • times (numpy.ndarray, optional) – A length T array of observer frame timestamps in JD for the telescope to attach.

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