pyLIMA.microlsimulator module

pyLIMA.microlsimulator.moon_illumination(sun, moon)[source]

The moon illumination expressed as a percentage.

Parameters:
  • sun (astropy) – the sun ephemeris
  • moon (astropy) – the moon ephemeris
Returns:

a numpy array indicated the moon illumination.

Return type:

array_like

pyLIMA.microlsimulator.noisy_observations(flux, error_flux)[source]

Add Poisson noise to observations.

Parameters:
  • flux (array_like) – the observed flux
  • error_flux (array_like) – the error on observed flux
Returns:

a numpy array which represents the observed noisy flux

Return type:

array_like

pyLIMA.microlsimulator.poisson_noise(flux)[source]

The Poisson noise.

Parameters:flux (array_like) – the observed flux
Returns:a numpy array which represents the Poisson noise,
Return type:array_like
pyLIMA.microlsimulator.red_noise(time)[source]

Simulate red moise as a sum of 10 low amplitudes/period sinusoidals.

Parameters:time (array_like) – the time in JD where you simulate red noise
Returns:a numpy array which represents the red noise
Return type:array_like
pyLIMA.microlsimulator.simulate_a_microlensing_event(name='Microlensing pyLIMA simulation', ra=270, dec=-30)[source]

Simulate a microlensing event. More details in the event module.

Parameters:
  • name (str) – the name of the event. Default is ‘Microlensing pyLIMA simulation’
  • ra (float) – the right ascension in degrees of your simulation. Default is 270.
  • dec (float) – the declination in degrees of your simulation. Default is -30.
Returns:

a event object

Return type:

object

pyLIMA.microlsimulator.simulate_a_microlensing_model(event, model='PSPL', args=(), parallax=['None', 0.0], xallarap='None', orbital_motion=['None', 0.0], source_spots='None')[source]

Simulate a a microlensing model.

Parameters:
  • event (object) – the microlensing event you look at. More details in event module
  • model (str) – the microlensing model you want. Default is ‘PSPL’. More details in microlmodels module
  • parallax (array_like) – the parallax effect you want to add. Default is no parallax. More details in microlmodels module
  • xallarap (array_like) – the xallarap effect you want to add. Default is no parallax. More details in microlmodels module
  • source_spots (str) – If you want to add source spots. Default is no source_spots. More details in microlmodels module
Returns:

a microlmodel object

Return type:

object

pyLIMA.microlsimulator.simulate_a_telescope(name, event, time_start, time_end, sampling, location, filter, uniform_sampling=False, altitude=0, longitude=0, latitude=0, spacecraft_name=None, bad_weather_percentage=0.0, minimum_alt=20, moon_windows_avoidance=20, maximum_moon_illumination=100.0)[source]
Simulate a telescope. More details in the telescopes module. The observations simulation are made for the
full time windows, then limitation are applied :
  • Sun has to be below horizon : Sun< -18
  • Moon has to be more than the moon_windows_avoidance distance from the target
  • Observations altitude of the target have to be bigger than minimum_alt
Parameters:
  • name (str) – the name of the telescope.
  • event (object) – the microlensing event you look at
  • time_start (float) – the start of observations in JD
  • time_end (float) – the end of observations in JD
  • sampling (float) – the hour sampling.
  • location (str) – the location of the telescope.
  • filter (str) – the filter used for observations
  • uniform_sampling (boolean) – set it to True if you want no bad weather, no moon avoidance etc....
  • altitude (float) – the altitude in meters if the telescope
  • longitude (float) – the longitude in degree of the telescope location
  • latitude (float) – the latitude in degree of the telescope location
  • spacecraft_name (str) – the name of your satellite according to JPL horizons
  • bad_weather_percentage (float) – the percentage of bad nights
  • minimum_alt (float) – the minimum altitude ini degrees that your telescope can go to.
  • moon_windows_avoidance (float) – the minimum distance in degrees accepted between the target and the Moon
  • maximum_moon_illumination (float) – the maximum Moon brightness you allow in percentage
Returns:

a telescope object

Return type:

object

pyLIMA.microlsimulator.simulate_fluxes_parameters(list_of_telescopes)[source]

Simulate flux parameters (magnitude_source , g) for the telescopes. More details in microlmodels module

Parameters:list_of_telescopes (list) – a list of telescopes object
Returns:fake_fluxes parameters, a set of fluxes parameters
Return type:list
pyLIMA.microlsimulator.simulate_lightcurve_flux(model, pyLIMA_parameters, red_noise_apply='Yes')[source]

Simulate the flux of telescopes given a model and a set of parameters. It updates straight the telescopes object inside the given model.

Parameters:
  • model (object) – the microlensing model you desire. More detail in microlmodels.
  • pyLIMA_parameters (object) – the parameters used to simulate the flux.
  • red_noise_apply (str) – to include or not red_noise
pyLIMA.microlsimulator.simulate_microlensing_model_parameters(model)[source]

Simulate parameters given the desired model. Parameters are selected in uniform distribution inside parameters_boundaries given by the microlguess modules. The exception is ‘to’ where it is selected to enter inside telescopes observations.

Parameters:event (object) – the microlensing event you look at. More details in event module
Returns:fake_parameters, a set of parameters
Return type:list
pyLIMA.microlsimulator.time_simulation(time_start, time_end, sampling, bad_weather_percentage)[source]

Simulate observing time during the observing windows, rejecting windows with bad weather.

Parameters:
  • time_start (float) – the start of observations in JD
  • time_end (float) – the end of observations in JD
  • sampling (float) – the number of points observed per hour.
  • bad_weather_percentage (float) – the percentage of bad nights
Returns:

a numpy array which represents the time of observations

Return type:

array_like