Tce

class exovetter.tce.Tce(*args, **kwargs)[source]

Bases: dict

Class to handle Threshold Crossing Event (TCE).

It inherits from dict and defines a list of reserved keywords in required_quantities, which must contain Quantity. Other keys in the dictionary have no restrictions.

By requiring that certain measured properties have units attached, it reduces the risk of modeling a transit with data in the wrong units; e.g., entering the transit duration in hours but treating the value as if it is the duration in days. It also allows depth given in parts per million to be used correctly in places that expect depth to be in fractional amplitude.

This class also handles the problem with transit times given in different zeropoints. Most transit data has times corrected to the barycentre of the solar system and expressed in the unit of days since some zeropoint. However, there is no agreement on the zeropoint. Some data is given in Julian Date, while other missions choose mission specific zeropoints; e.g., t=0 for Kepler data corresponds to a Barycentric Julian Date (BJD) of 2454833. This problem is addressed here by requiring epoch and period data to be Quantity and by providing a get_epoch() method.

Raises:
KeyError

Required quantities missing, causing validate() to fail.

Attributes:
required_quantitiesset

Keys in which their values must be Quantity.

Attributes Summary

required_quantities

Methods Summary

from_json(filename)

Read a json file and populate a TCE object

get_epoch([offset])

Get the epoch of the transit in the desired BJD-based time system.

to_json(filename)

Write a json file with standard file name

validate()

Check that required quantities are present.

Attributes Documentation

required_quantities = {'depth', 'duration', 'epoch', 'epoch_offset', 'period'}

Methods Documentation

classmethod from_json(filename)[source]

Read a json file and populate a TCE object

Parameters:
filenamestring

Filename of json file containing tce informamtion

Returns:
None.
get_epoch(offset=None)[source]

Get the epoch of the transit in the desired BJD-based time system.

The time of first transit of your TCE is stored as a date offset from BJD=0 by an amount given by offset (e.g., BKJD, TJD). This method converts the time of the first transit to a time offset from the epoch desired.

Parameters:
offsetQuantity

The epoch offset desired. Some pre-defined offsets are available in exovetter.const. For example, the time of first transit in bkjd.

Returns:
epochQuantity

Epoch of the transit in the desired BJD-based time system.

Raises:
KeyError

Calculation failed due to missing keys.

to_json(filename)[source]

Write a json file with standard file name

Parameters:
filenamestring
Filename to write the json string.
Returns:
tce_jsonjson formatted string
validate()[source]

Check that required quantities are present.

Returns:
statusbool

True if validation passes.

Raises:
KeyError

Some required quantities are missing.

TyperError

Some required quantities do not have units attached.