pyLIMA.event module

Created on Thu Aug 27 16:39:32 2015

@author: ebachelet

class pyLIMA.event.Event[source]

Bases: object

######## Event module ########

This module create an event object with the informations (attributes) needed for the fits.

Attributes :

kind : type of event. In general, should be ‘Microlensing’ (default)

name : name of the event. Should be a string. Default is ‘Sagittarius A*’

ra : right ascension of the event (J2000). Should be a float in degree between 0.0 and 360.0. Default is ra of Sagittarius A, \(\alpha\) = 266.416792 from Baker & Sramek 1999ApJ...524..805B

dec : declination of the event (J2000). Should be a float in degree between -90 and 90. Default is dec of Sagittarius A, \(\delta\) = -29.007806 from Baker & Sramek 1999ApJ...524..805B

Teff : effective temperature of the star in Kelvin. Should be a float. Default is 5000.0 K

log_g : surface gravity in log10 cgs unit. Should be a float. Default is 4.5

telescopes : list of telescopes names (strings). Default is an empty list. Have to be fill with some telescopes class instances.

survey : the reference telescope. Has to be a string, default is ‘None’.

fits : list of microlfits objects.

check_event()[source]

Function to check if everything is correctly set before the fit. An ERROR is returned if the check is not successful Should be used before any event_fit function calls

First check if the event name is a string. Then check if the right ascension (event.ra) is between 0 and 360 degrees. Then check if the declination (event.dec) is between -90 and 90 degrees. Then check if you have any telescopes ingested. Finally check if your telescopes have a lightcurve attributes different from None.

compute_parallax_all_telescopes(parallax_model)[source]

Compute the parallax displacement for all the telescopes, if this is desired in the second order parameter.

find_survey(choice=None)[source]

Function to find the survey telescope in the telescopes list, and put it on the first place (useful for some fits functions).

Parameters:choice – the name of the telescope choosing as the survey. Has to be a string. Default is the first telescope.
fit(model, method, DE_population_size=10, flux_estimation_MCMC='MCMC', fix_parameters_dictionnary=None, grid_resolution=10, computational_pool=None, binary_regime=None)[source]

Function to fit the event with a model and a method.

Parameters:
  • model – the model you want to fit. More details in the microlfits module
  • method – the fitting method you want to use. Has to be a string in the

available_methods parameter:

‘LM’ : Levenberg-Marquardt algorithm

‘DE’ : Differential Evolution algorithm

‘MCMC’ : Monte-Carlo Markov Chain algorithm

More details in the microlfits module

A microlfits object is added in the event.fits list. For example, if you request two fits, you will obtain :

event.fits=[fit1,fit2]

More details in the microlfits module.

lightcurves_in_flux(choice='Yes')[source]

Transform all telescopes magnitude lightcurves in flux units.

Parameters:choice – to clean your lightcurve or not. Has to be a string ‘Yes’ or ‘No’.

Defaul is ‘Yes’. More details in the telescope module

telescopes_names()[source]

Print the the telescope’s names contain in the event.

total_number_of_data_points()[source]

Compute the parallax displacement for all the telescopes, if this is desired in the second order parameter. :return: n_data, the total number of points :rtype: float

exception pyLIMA.event.EventException[source]

Bases: exceptions.Exception