KeplerQualityFlags

class lightkurve.utils.KeplerQualityFlags

Bases: lightkurve.utils.QualityFlags

This class encodes the meaning of the various Kepler QUALITY bitmask flags, as documented in the Kepler Archive Manual (Ref. [1], Table 2.3).

References

R98c57f8b1d1e-1

Kepler: A Search for Terrestrial Planets. Kepler Archive Manual. http://archive.stsci.edu/kepler/manuals/archive_manual.pdf

Attributes Summary

ApertureCosmic

Argabrightening

ArgabrighteningOnCCD

AttitudeTweak

CoarsePoint

CollateralCosmic

DEFAULT_BITMASK

DEFAULT bitmask identifies all cadences which are definitely useless.

Desat

DetectorAnomaly

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

NoData

NoFinePoint

OPTIONS

Dictionary which provides friendly names for the various bitmasks.

PossibleThrusterFiring

RollingBandInAperture

RollingBandInMask

STRINGS

Pretty string descriptions for each flag

SafeMode

SensitivityDropout

ThrusterFiring

ZeroCrossing

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 = 128
Argabrightening = 64
ArgabrighteningOnCCD = 4096
AttitudeTweak = 1
CoarsePoint = 4
CollateralCosmic = 8192
DEFAULT_BITMASK = 1130799

DEFAULT bitmask identifies all cadences which are definitely useless.

Desat = 32
DetectorAnomaly = 16384
EarthPoint = 8
HARDEST_BITMASK = 2096639

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

HARD_BITMASK = 1664431

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

ImpulsiveOutlier = 2048
ManualExclude = 256
NoData = 65536
NoFinePoint = 32768
OPTIONS = {'default': 1130799, 'hard': 1664431, 'hardest': 2096639, 'none': 0}

Dictionary which provides friendly names for the various bitmasks.

PossibleThrusterFiring = 524288
RollingBandInAperture = 131072
RollingBandInMask = 262144
STRINGS = {1: 'Attitude tweak', 2: 'Safe mode', 4: 'Coarse point', 8: 'Earth point', 16: 'Zero crossing', 32: 'Desaturation event', 64: 'Argabrightening', 128: 'Cosmic ray in optimal aperture', 256: 'Manual exclude', 1024: 'Sudden sensitivity dropout', 2048: 'Impulsive outlier', 4096: 'Argabrightening on CCD', 8192: 'Cosmic ray in collateral data', 16384: 'Detector anomaly', 32768: 'No fine point', 65536: 'No data', 131072: 'Rolling band in optimal aperture', 262144: 'Rolling band in full mask', 524288: 'Possible thruster firing', 1048576: 'Thruster firing'}

Pretty string descriptions for each flag

SafeMode = 2
SensitivityDropout = 1024
ThrusterFiring = 1048576
ZeroCrossing = 16

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_arrayarray of int

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

bitmaskint or str

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

Returns
boolean_maskarray 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
qualityint

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

Returns
flagslist of str

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