Utilities

class pyke.utils.KeplerQualityFlags[source]

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

Methods

decode(quality) Converts a Kepler QUALITY value into a list of human-readable strings.
ApertureCosmic = 128
Argabrightening = 64
ArgabrighteningOnCCD = 4096
AttitudeTweak = 1
CoarsePoint = 4
CollateralCosmic = 8192
DEFAULT_BITMASK = 1130927
Desat = 32
DetectorAnomaly = 16384
EarthPoint = 8
HARDEST_BITMASK = 2096639
HARD_BITMASK = 1664431
ImpulsiveOutlier = 2048
ManualExclude = 256
NoData = 65536
NoFinePoint = 32768
OPTIONS = {'default': 1130927, 'hard': 1664431, 'hardest': 2096639}
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'}
SafeMode = 2
SensitivityDropout = 1024
ThrusterFiring = 1048576
ZeroCrossing = 16
classmethod decode(quality)[source]

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.

pyke.utils.module_output_to_channel(module, output)[source]

Returns the CCD channel number for a given module and output pair.

Parameters:

module : int

Module number

output : int

Output number

Returns:

channel : int

Channel number

pyke.utils.channel_to_module_output(channel)[source]

Returns a (module, output) pair given a CCD channel number.

Parameters:

channel : int

Channel number

Returns:

module, output : tuple of ints

Module and Output number