MicroLIA.noise_models
Created on Thu July 28 20:30:11 2018
@author: danielgodinez
Module Contents
Functions
|
Creates a noise model by fitting a one-dimensional smoothing |
|
Adds noise to magnitudes given a noise function. |
|
Adds noise to lightcurve given the magnitudes. |
- MicroLIA.noise_models.create_noise(median, rms, degree=3)[source]
Creates a noise model by fitting a one-dimensional smoothing spline of degree k.
- Parameters:
median (array) – Baseline magnitudes.
rms (array) – Corresponding RMS per baseline.
k (int) – Degree of the smoothing spline. Default is a cubic spline of degree 3.
- Returns:
fn
- Return type:
The kth degree spline fit.
- MicroLIA.noise_models.add_noise(mag, fn, zp=24, exptime=60)[source]
Adds noise to magnitudes given a noise function.
- Parameters:
mag (array) – Magnitude to add noise to.
fn (function) – Spline fit, must be defined using the create_noise function.
zp (Zeropoint) – Zeropoint of the instrument, default is 24.
exptime (Exposure time) – The exposure time of the observations.
- Returns:
mag (array) – The noise-added magnitudes.
magerr (array) – The corresponding magnitude errors.
- MicroLIA.noise_models.add_gaussian_noise(mag, zp=24, exptime=60)[source]
Adds noise to lightcurve given the magnitudes.
- Parameters:
mag (array) – Mag array to add noise to.
zp (zeropoint) – Zeropoint of the instrument, default is 24.
convert (boolean, optional) –
- Returns:
noisy_mag (array) – The noise-added magnitude.
magerr (array) – The corresponding magnitude errors.