TessQualityFlags

class lightkurve.utils.TessQualityFlags[source]

Bases: lightkurve.utils.QualityFlags

This class encodes the meaning of the various TESS QUALITY bitmask flags, as documented in the TESS Data Products Description Document (Ref. [1], Table 26).

References

[1]TESS Science Data Products Description Document (EXP-TESS-ARC-ICD-0014) https://archive.stsci.edu/missions/tess/doc/EXP-TESS-ARC-ICD-TM-0014.pdf

Attributes Summary

ApertureCosmic
Argabrightening
AttitudeTweak
CoarsePoint
CollateralCosmic
DEFAULT_BITMASK DEFAULT bitmask identifies all cadences which are definitely useless.
Desat
Discontinuity
EarthPoint
HARDEST_BITMASK HARDEST bitmask identifies cadences with any flag set.
HARD_BITMASK HARD bitmask is conservative and may identify cadences which are useful.
ImpulsiveOutlier
ManualExclude
OPTIONS Dictionary which provides friendly names for the various bitmasks.
STRINGS Pretty string descriptions for each flag
SafeMode
Straylight

Methods Summary

create_quality_mask(quality_array[, bitmask]) Returns a boolean array which flags good cadences given a bitmask.
decode(quality) Converts a Kepler QUALITY value into a list of human-readable strings.

Attributes Documentation

ApertureCosmic = 64
Argabrightening = 16
AttitudeTweak = 1
CoarsePoint = 4
CollateralCosmic = 1024
DEFAULT_BITMASK = 687

DEFAULT bitmask identifies all cadences which are definitely useless.

Desat = 32
Discontinuity = 256
EarthPoint = 8
HARDEST_BITMASK = 4095

HARDEST bitmask identifies cadences with any flag set. Its use is not recommended.

HARD_BITMASK = 3823

HARD bitmask is conservative and may identify cadences which are useful.

ImpulsiveOutlier = 512
ManualExclude = 128
OPTIONS = {'default': 687, 'hard': 3823, 'hardest': 4095, 'none': 0}

Dictionary which provides friendly names for the various bitmasks.

STRINGS = {1: 'Attitude tweak', 2: 'Safe mode', 4: 'Coarse point', 8: 'Earth point', 16: 'Argabrightening', 32: 'Desaturation event', 64: 'Cosmic ray in optimal aperture', 128: 'Manual exclude', 256: 'Discontinuity corrected', 512: 'Impulsive outlier', 1024: 'Cosmic ray in collateral data', 2048: 'Straylight'}

Pretty string descriptions for each flag

SafeMode = 2
Straylight = 2048

Methods Documentation

classmethod create_quality_mask(quality_array, bitmask=None)

Returns a boolean array which flags good cadences given a bitmask.

This method is used by the constructors of KeplerTargetPixelFile and KeplerLightCurveFile to initialize their quality_mask class attribute which is used to ignore bad-quality data.

Parameters:
quality_array : array of int

‘QUALITY’ column of a Kepler target pixel or lightcurve file.

bitmask : int or str

Bitmask (int) or one of ‘none’, ‘default’, ‘hard’, or ‘hardest’.

Returns:
boolean_mask : array of bool

Boolean array in which True means the data is of good quality.

classmethod decode(quality)

Converts a Kepler QUALITY value into a list of human-readable strings.

This function takes the QUALITY bitstring that can be found for each cadence in Kepler/K2’s pixel and light curve files and converts into a list of human-readable strings explaining the flags raised (if any).

Parameters:
quality : int

Value from the ‘QUALITY’ column of a Kepler/K2 pixel or lightcurve file.

Returns:
flags : list of str

List of human-readable strings giving a short description of the quality flags raised. Returns an empty list if no flags raised.