pytransit.contamination

Module to model flux contamination in transit light curves.

class pytransit.contamination.SMContamination(instrument: pytransit.contamination.instrument.Instrument, ref_pb: str = None)[source]

Bases: pytransit.contamination.contamination._BaseContamination

A class that models flux contamination based on stellar spectrum models.

absolute_flux(teff: float, wl: Union[float, Iterable[T_co]]) → numpy.ndarray[source]

The absolute flux given an effective temperature and a set of wavelength.

Parameters:
  • teff (float) – The effective temperature [K]
  • wl (array-like) – The wavelengths to calculate the flux in [nm]
Returns:

Return type:

Spectral radiance.

apply_extinction
contamination(cref: Union[float, numpy.ndarray], teff1: Union[float, numpy.ndarray], teff2: Union[float, numpy.ndarray])[source]

Contamination given reference contamination, host TEff, and contaminant TEff(s)

Per-passband contamination given the contamination in the reference passband and TEffs of the two stars.

Parameters:
  • cref (float) – contamination in the reference passband
  • teff1 – Effective stellar temperature [K]
  • teff2 – Effective stellar temperature [K]
Returns:

Return type:

Per-passband contamination

reddening(a)[source]
relative_flux(teff: float, wl: Union[float, numpy.ndarray], wlref: float) → numpy.ndarray[source]

The stellar flux normalized to a given reference wavelength.

Parameters:
  • teff (float) – The effective temperature of the radiating body [K]
  • wl (array-like) – The wavelengths to calculate the flux in [nm]
  • wlref (float) – The reference wavelength [nm]
Returns:

Return type:

The flux normalized to a given reference wavelength

relative_flux_mixture(teffs, fractions, rdc=None)[source]
relative_fluxes(teff: Union[float, numpy.ndarray], rdc=None, rpb=None)[source]
class pytransit.contamination.BBContamination(instrument: pytransit.contamination.instrument.Instrument, ref_pb: str, delta_l: float = 10)[source]

Bases: pytransit.contamination.contamination._BaseContamination

Third light contamination based on black body approximation.

This class offers a simple black-body model for flux contamination in which the target star and the contaminant(s) are approximated as black bodies with effective temperatures Tt, Tc1, Tc2, …, Tcn.

static absolute_flux(teff: float, wl: Union[float, Iterable[T_co]]) → numpy.ndarray[source]

The absolute flux given an effective temperature and wavelength.

Parameters:
  • teff – The effective temperature in K
  • wl – The wavelength (or an array of) in nm
Returns:

Return type:

Black body spectral radiance.

absolute_fluxes(teff: float) → numpy.ndarray[source]

Calculates the integrated absolute fluxes for all filters for a star with the given effective temperature

Parameters:teff – The effective temperature of the radiating body [K]
Returns:
Return type:The integrated absolute fluxes for the filters in the instrument.
contamination(cref: float, teff1: float, teff2: float) → numpy.ndarray[source]

Calculates the contamination factors for all the filters given the contamination in the reference passband.

Parameters:
  • cref – Reference passband contamination
  • teff1 – Host star effective temperature
  • teff2 – Contaminant effective temperature
Returns:

Return type:

Contamination factors for all the filters.

static relative_flux(teff: float, wl: Union[float, numpy.ndarray], wlref: float) → numpy.ndarray[source]

The black body flux normalized to a given reference wavelength.

Parameters:
  • teff – The effective temperature of the radiating body [K]
  • wl – The wavelength [nm]
  • wlref – The reference wavelength [nm]
Returns:

Return type:

The black body flux normalized to a given reference wavelength

relative_fluxes(teff: Union[float, numpy.ndarray]) → numpy.ndarray[source]

Calculates the integrated fluxes for all filters normalized to the reference passband.

Parameters:teff – The effective temperature of the radiating body [K]
Returns:
Return type:The integrated fluxes for all filters normalized to the reference passband.
class pytransit.contamination.Instrument(name, filters, qes=None)[source]

Bases: object

class pytransit.contamination.ClearFilter(name)[source]

Bases: pytransit.contamination.filter.Filter

Constant unity transmission.

class pytransit.contamination.BoxcarFilter(name, wl_min, wl_max)[source]

Bases: pytransit.contamination.filter.Filter

Filter with a transmission of 1 inside the minimum and maximum wavelengths and 0 outside.

class pytransit.contamination.TabulatedFilter(name, wl, tm)[source]

Bases: pytransit.contamination.filter.Filter

Interpolated tabulated filter.

pytransit.contamination.true_radius_ratio(apparent_k: float, contamination: float) → float[source]
pytransit.contamination.apparent_radius_ratio(true_k: float, contamination: float) → float[source]
pytransit.contamination.contaminate_light_curve[source]

Contaminates a transit light curve.

Contaminates a transit light curve with npb passbands.

Parameters:
  • flux (1d array-like) – Transit light curve with npb passbands.
  • contamination (1d array-like) – Array of per-passband contamination values.
  • pbids (1d array-like) – Passband indices that map each light curve element to a single passband.
Returns:

Return type:

Contaminated transit light curve