pyLIMA.microlmodels

Created on Mon Dec 7 10:32:13 2015

@author: ebachelet

Module Contents

Classes

MLModel ######## MLModels module ########
ModelPSPL ######## MLModels module ########
ModelFSPL ######## MLModels module ########
ModelFSPLee ######## MLModels module ########
ModelFSPLarge ######## MLModels module ########
ModelDSPL ######## MLModels module ########
ModelDFSPL ######## MLModels module ########
ModelFSBL ######## MLModels module ########
ModelUSBL ######## MLModels module ########
ModelPSBL ######## MLModels module ########
ModelVariablePL ######## MLModels module ########

Functions

create_model(model_type, event, model_arguments=[], parallax=[‘None’, 0.0], xallarap=[‘None’], orbital_motion=[‘None’, 0.0], source_spots=’None’, blend_flux_ratio=True) Load a model according to the supplied model_type. Models are expected to be named
pyLIMA.microlmodels.thismodule[source]
pyLIMA.microlmodels.resource_package[source]
pyLIMA.microlmodels.resource_path[source]
pyLIMA.microlmodels.template[source]
pyLIMA.microlmodels.yoo_table[source]
pyLIMA.microlmodels.b0b1[source]
pyLIMA.microlmodels.zz[source]
pyLIMA.microlmodels.b0[source]
pyLIMA.microlmodels.b1[source]
pyLIMA.microlmodels.interpol_b0[source]
pyLIMA.microlmodels.interpol_b1[source]
pyLIMA.microlmodels.dB0[source]
pyLIMA.microlmodels.dB1[source]
pyLIMA.microlmodels.dB0[source]
pyLIMA.microlmodels.dB0[source]
pyLIMA.microlmodels.dB1[source]
pyLIMA.microlmodels.dB1[source]
pyLIMA.microlmodels.interpol_db0[source]
pyLIMA.microlmodels.interpol_db1[source]
pyLIMA.microlmodels.yoo_table[source]
exception pyLIMA.microlmodels.ModelException[source]

Bases: Exception

Common base class for all non-exit exceptions.

pyLIMA.microlmodels.create_model(model_type, event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Load a model according to the supplied model_type. Models are expected to be named Model<model_type> e.g. ModelPSPL

Parameters:model_type (string) – Model type e.g. PSPL
Returns:Model object for given model_type
class pyLIMA.microlmodels.MLModel(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: object

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
__metaclass__[source]
model_type(self)[source]
paczynski_model_parameters(self)[source]
model_magnification(self, telescope, pyLIMA_parameters)[source]
define_pyLIMA_standard_parameters(self)[source]

Define the standard pyLIMA parameters dictionnary.

define_model_parameters(self)[source]

Define the model parameters dictionnary. It is different to the pyLIMA_standards_dictionnary if you have some fancy parameters request.

print_model_parameters(self)[source]

Define the model parameters dictionnary and print for the users.

compute_the_microlensing_model(self, telescope, pyLIMA_parameters)[source]

Compute the microlens model according the injected parameters. This is modified by child submodel sublclass, if not the default microlensing model is returned.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

the microlensing model

Return type:

array_like

_default_microlensing_model(self, telescope, pyLIMA_parameters, amplification)[source]

Compute the default microlens model according the injected parameters:

flux(t) = f_source*magnification(t)+f_blending

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
  • amplification (array_like) – the magnification associated to the model
Returns:

the microlensing model, the microlensing priors

Return type:

array_like, float

derive_telescope_flux(self, telescope, pyLIMA_parameters, amplification)[source]

Compute the source/blending flux

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
  • amplification (array_like) – an array containing the magnification
Returns:

the source and the blending flux

Return type:

tuple

compute_pyLIMA_parameters(self, fancy_parameters)[source]

Realize the transformation between the fancy parameters to fit to the standard pyLIMA parameters needed to compute a model.

Parameters:fancy_parameters (list) – the parameters you fit
Returns:pyLIMA parameters
Return type:object (namedtuple)
find_origin(self, pyLIMA_parameters)[source]
uo_to_from_uc_tc(self, pyLIMA_parameters)[source]
uc_tc_from_uo_to(selfself, pyLIMA_parameters)[source]
fancy_parameters_to_pyLIMA_standard_parameters(self, fancy_parameters)[source]

Transform the fancy parameters to the pyLIMA standards. The output got all the necessary standard attributes, example to, uo, tE…

Parameters:fancy_parameters (object) – the fancy_parameters as namedtuple
Returns:the pyLIMA standards are added to the fancy parameters
Return type:object
pyLIMA_standard_parameters_to_fancy_parameters(self, pyLIMA_parameters)[source]
Transform the the pyLIMA standards parameters to the fancy parameters. The output got all
the necessary fancy attributes.
Parameters:pyLIMA_parameters (object) – the standard pyLIMA parameters as namedtuple
Returns:the fancy parameters are added to the fancy parameters
Return type:object
source_trajectory(self, telescope, to, uo, tE, pyLIMA_parameters)[source]

Compute the microlensing source trajectory associated to a telescope for the given parameters.

Parameters:
  • to (float) – time of maximum magnification
  • uo (float) – minimum impact parameter
  • tE (float) – angular Einstein ring crossing time
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

source_trajectory_x, source_trajectory_y the x,y compenents of the source trajectory

Return type:

array_like,array_like

class pyLIMA.microlmodels.ModelPSPL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:PSPL
Return type:string
paczynski_model_parameters(self)[source]

Define the PSPL standard parameters, [to,uo,tE]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a PSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification

Return type:

array_like

Jacobian_model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a PSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

model_Jacobian(self, telescope, pyLIMA_parameters)[source]

The derivative of a PSPL model

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

jacobi

Return type:

array_like

class pyLIMA.microlmodels.ModelFSPL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:FSPL
Return type:string
paczynski_model_parameters(self)[source]

Define the FSPL standard parameters, [to,uo,tE,rho]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a FSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

Jacobian_model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a FSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

model_Jacobian(self, telescope, pyLIMA_parameters)[source]

The derivative of a FSPL model

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

jacobi

Return type:

array_like

class pyLIMA.microlmodels.ModelFSPLee(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:FSPL-Lee method
Return type:string
paczynski_model_parameters(self)[source]

Define the FSPL standard parameters, [to,uo,tE,rho]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a FSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

class pyLIMA.microlmodels.ModelFSPLarge(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:FSPL-VBB method
Return type:string
paczynski_model_parameters(self)[source]

Define the FSPL standard parameters, [to,uo,tE,rho]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a FSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

class pyLIMA.microlmodels.ModelDSPL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:DSPL
Return type:string
paczynski_model_parameters(self)[source]

Define the DSPL standard parameters, [to1,uo1,to2,uo2,tE,q_F_filters]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a DSPL model. From Hwang et al 2013 : http://iopscience.iop.org/article/10.1088/0004-637X/778/1/55/pdf

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

class pyLIMA.microlmodels.ModelDFSPL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:DFSPL
Return type:string
paczynski_model_parameters(self)[source]

Define the DFSPL standard parameters, [to1,uo1,to2,uo2,tE,rho_1,rho_2,q_F_filters]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a DFSPL model. From Hwang et al 2013 : http://iopscience.iop.org/article/10.1088/0004-637X/778/1/55/pdf

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification, impact_parameter

Return type:

array_like,array_like

class pyLIMA.microlmodels.ModelFSBL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

:returns:FSBL :rtype: string

paczynski_model_parameters(self)[source]

Define the USBL standard parameters, [to,uo,tE,rho, s,q,alpha]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a FSBL model. From Bozza 2010 : http://adsabs.harvard.edu/abs/2010MNRAS.408.2188B

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification,

Return type:

array_like,

find_caustics(self, separation, mass_ratio)[source]

The caustics, critical_curves and area of interest associated to the separation and mass ratio

Parameters:
  • separation (float) – the binary lens component separation
  • mass ratio (float) – the binary lens component mass ratio
find_origin(self, pyLIMA_parameters)[source]

Find the origin of the binary system, if needed. Useful for fine modeling and simulations.

Parameters:pyLIMA_parameters (object) – the object containint all model parameters
uo_to_from_uc_tc(self, pyLIMA_parameters)[source]

Find the associated to,uo from the new origin of the binary system, if needed. Useful for fine modeling and simulations.

param object pyLIMA_parameters:
 the object containint all model parameters
returns:to,uo the new origin parameters tc, uc (impact parameter associated to the new origin)
rtype:float,float
uc_tc_from_uo_to(self, pyLIMA_parameters, to, uo)[source]
find_binary_regime(self, pyLIMA_parameters)[source]
class pyLIMA.microlmodels.ModelUSBL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.ModelFSBL

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:USBL
Return type:string
paczynski_model_parameters(self)[source]

Define the USBL standard parameters, [to,uo,tE,rho, s,q,alpha]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a USBL model. From Bozza 2010 : http://adsabs.harvard.edu/abs/2010MNRAS.408.2188B

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification,

Return type:

array_like,

class pyLIMA.microlmodels.ModelPSBL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.ModelFSBL

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

:returns:PSBL :rtype: string

paczynski_model_parameters(self)[source]

Define the PSBL standard parameters, [to,uo,tE, s,q,alpha]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a PSBL model. From Bozza 2010 : http://adsabs.harvard.edu/abs/2010MNRAS.408.2188B

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification,

Return type:

array_like,

class pyLIMA.microlmodels.ModelVariablePL(event, model_arguments=[], parallax=['None', 0.0], xallarap=['None'], orbital_motion=['None', 0.0], source_spots='None', blend_flux_ratio=True)[source]

Bases: pyLIMA.microlmodels.MLModel

######## MLModels module ########

This class defines the model you want to fit your data to. Model is the parent class, each model is a child class (polymorphism), for example ModelPSPL.

Attributes :

event : A event class which describe your event that you want to model. See the event module.

parallax_model : Parallax model you want to use for the Earth types telescopes.

Has to be a list containing the model in the available_parallax parameter and the value of topar. Have a look here for more details : http://adsabs.harvard.edu/abs/2011ApJ…738…87S

‘Annual’ –> Annual parallax ‘Terrestrial’ –> Terrestrial parallax ‘Full’ –> combination of previous

topar –> a time in HJD choosed as the referenced time fot the parallax

If you have some Spacecraft types telescopes, the space based parallax is computed if parallax is different of ‘None’ More details in the microlparallax module

xallarap_model : not available yet

orbital_motion_model : not available yet

‘None’ –> No orbital motion ‘2D’ –> Classical orbital motion ‘3D’ –> Full Keplerian orbital motion

toom –> a time in HJD choosed as the referenced time fot the orbital motion
(Often choose equal to topar)

More details in the microlomotion module

source_spots_model : not available yet

‘None’ –> No source spots

More details in the microlsspots module

yoo_table : an array which contains the Yoo et al table

Jacobian_flag : a flag indicated if a Jacobian can be used (‘OK’) or not.

model_dictionnary : a python dictionnary which describe the model parameters

pyLIMA_standards_dictionnary : the standard pyLIMA parameters dictionnary

fancy_to_pyLIMA_dictionnary : a dictionnary which described which fancy parameters replace a standard pyLIMA
parameter. For example : {‘logrho’: ‘rho’}

pyLIMA_to_fancy : a dictionnary which described the function to transform the standard pyLIMA parameter to the fancy one. Example : {‘logrho’: lambda parameters: np.log10(parameters.rho)}

fancy_to_pyLIMA : a dictionnary which described the function to transform the fancy parameters to pyLIMA standards. Example : {‘rho’: lambda parameters: 10 ** parameters.logrho}

parameters_guess : a list containing guess on pyLIMA parameters.

Parameters:
  • event (object) – a event object. More details on the event module.
  • parallax (list) – a list of [string,float] indicating the parallax model you want and to_par
  • xallarap (list) – a list of [string,float] indicating the xallarap mode.l. NOT WORKING NOW.
  • orbital_motion (list) – a list of [string,float] indicating the parallax model you want and to_om. NOT WORKING NOW.
  • source_spots (string) – a string indicated the source_spots you want. NOT WORKING.
model_type[source]

Return the kind of microlensing model.

Returns:VariablePL
Return type:string
paczynski_model_parameters(self)[source]

Define the PSPL standard parameters, [to,uo,tE]

Returns:a dictionnary containing the pyLIMA standards
Return type:dict
model_magnification(self, telescope, pyLIMA_parameters)[source]

The magnification associated to a PSPL model. More details in microlmagnification module.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

magnification

Return type:

array_like

compute_the_microlensing_model(self, telescope, pyLIMA_parameters)[source]

Compute the microlens model according the injected parameters. This is modified by child submodel sublclass, if not the default microlensing model is returned.

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
Returns:

the microlensing model

Return type:

array_like

derive_telescope_flux(self, telescope, pyLIMA_parameters, amplification, pulsations)[source]

Compute the source/blending flux

Parameters:
  • telescope (object) – a telescope object. More details in telescope module.
  • pyLIMA_parameters (object) – a namedtuple which contain the parameters
  • amplification (array_like) – an array containing the magnification
Returns:

the source and the blending flux

Return type:

tuple

compute_pulsations(self, time, filter, pyLIMA_parameters)[source]