Observations (taurex.spectrum)

Base

Contains the basic definition of an observed spectrum for TauRex 3

class BaseSpectrum(name)[source]

Bases: taurex.log.logger.Logger, taurex.data.fittable.Fittable, taurex.output.writeable.Writeable

Abstract class

A base class where spectrums are loaded (or later created). This is used to either plot against the forward model or passed into the optimizer to be used to fit the forward model

Parameters

name (str) – Name to be used in logging

property binEdges

Requires Implementation

Should return the bin edges of the wavenumber grid

Raises

NotImplementedError

property binWidths

Requires Implementation

Should return the widths of each bin in the wavenumber grid

Raises

NotImplementedError

create_binner()[source]

Creates the appropriate binning object

property derivedParameters
property errorBar

Requires Implementation

Should return the error. Must be the same shape as spectrum()

Raises

NotImplementedError

property fittingParameters
classmethod input_keywords()[source]
property rawData

Requires Implementation

Should return the raw data set.

Raises

NotImplementedError

property spectrum

Requires Implementation

Should return the observed spectrum.

Raises

NotImplementedError

property wavelengthGrid

Requires Implementation

Should return the wavelength grid of the spectrum in microns. This does not need to necessarily match the shape of spectrum()

Raises

NotImplementedError

property wavenumberGrid

Wavenumber grid in cm-1

Returns

wngrid

Return type

array

write(output)[source]

Array

class ArraySpectrum(spectrum=None)[source]

Bases: taurex.data.spectrum.spectrum.BaseSpectrum

Loads an observed spectrum from an array and computes bin edges and bin widths. Spectrum shape(nbins, 3-4) with 3-4 columns with ordering:

  1. wavelength (um)

  2. spectral data

  3. error

  4. (optional) bin width

If no bin width is present then they are computed.

Parameters

filename (string) – Path to observed spectrum file.

property binEdges

Bin edges

property binWidths

bin widths

property errorBar

Error bars for the spectrum

classmethod input_keywords()[source]
manual_binning()[source]
property rawData

Data read from file

property spectrum

The spectrum itself

property wavelengthGrid

Wavelength grid in microns

property wavenumberGrid

Wavenumber grid in cm-1

Observed

class ObservedSpectrum(filename=None)[source]

Bases: taurex.data.spectrum.array.ArraySpectrum

Loads an observed spectrum from a text file and computes bin edges and bin widths. Spectrum must be 3-4 columns with ordering:

  1. wavelength

  2. spectral data

  3. error

  4. (optional) bin width

If no bin width is present then they are computed.

Parameters

filename (string) – Path to observed spectrum file.

classmethod input_keywords()[source]

Iraclis

class IraclisSpectrum(filename=None)[source]

Bases: taurex.data.spectrum.array.ArraySpectrum

Loads an observation from Iraclis pickle data

Parameters

filename (string) – Path to observed spectrum file.

classmethod input_keywords()[source]

Taurex

class TaurexSpectrum(filename=None)[source]

Bases: taurex.data.spectrum.array.ArraySpectrum

Observation is a taurex spectrum from a HDF5 file

An instrument function must have been used for this to work

Parameters

filename (string) – Path to taurex spectrum HDF5 output.

Lightcurves

Module dealing with observed lightcurves

class ObservedLightCurve(filename=None)[source]

Bases: taurex.data.spectrum.spectrum.BaseSpectrum

Loads an observed lightcurve from a pickle file.

Parameters

filename (str) – Path to pickle file containing lightcurve data

property binEdges

Returns bin edges for wavelength grid

Returns

out

Return type

array

property binWidths

Widths for each bin in wavelength grid

Returns

out

Return type

array

create_binner()[source]

Creates the appropriate binning object

property errorBar

Like spectrum() except its the error at each point in the lightcurve spectrum

Returns

err – Error at each point in lightcurve spectrum

Return type

array

classmethod input_keywords()[source]
property rawData

Raw lightcurve data read from file

Returns

lc_data

Return type

array

property spectrum

Returns Light curve spectrum. The lightcurve spectrum comes in the form of multiple lightcurves stuck together into one long spectrum. The number of lightcurves is equal to the number of bins in wavelengthGrid().

Returns

spectrum

Return type

array

property wavelengthGrid

Returns wavelength grid in microns

Returns

wlgrid

Return type

array

write(output)[source]