MicroLIA.noise_models

Created on Thu July 28 20:30:11 2018

@author: danielgodinez

Module Contents

Functions

create_noise(→ scipy.interpolate.UnivariateSpline)

Creates a noise model by fitting a one-dimensional smoothing

add_noise(→ Tuple[numpy.ndarray, numpy.ndarray])

Adds noise to magnitudes given a noise function.

add_gaussian_noise(→ Tuple[numpy.ndarray, numpy.ndarray])

Adds noise to lightcurve given the magnitudes.

MicroLIA.noise_models.create_noise(median: numpy.typing.ArrayLike, rms: numpy.typing.ArrayLike, degree: int = 3) scipy.interpolate.UnivariateSpline[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: numpy.typing.ArrayLike, fn: Callable[[numpy.typing.ArrayLike], numpy.ndarray], zp: float = 24, exptime: int = 60) Tuple[numpy.ndarray, numpy.ndarray][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 (float) – Zeropoint of the instrument, default is 24.

  • exptime (int) – 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: numpy.typing.ArrayLike, zp: float = 24, exptime: int = 60) Tuple[numpy.ndarray, numpy.ndarray][source]

Adds noise to lightcurve given the magnitudes.

Parameters:
  • mag (array) – Mag array to add noise to.

  • zp (float) – Zeropoint of the instrument, default is 24.

  • exptime (int) – The exposure time of the observations.

Returns:

  • noisy_mag (array) – The noise-added magnitude.

  • magerr (array) – The corresponding magnitude errors.