Quality Control (QC)

The KPF DRP has several Quality Control (QC) methods that can be run on the L0, 2D, L1, and 2D objects. The usual application of QC tests is executing them during normal processing in the main recipe. The QC methods are defined in the QCDefinitions class in modules/quality_control/src/quality_control.py. The results of these QC checks are added to the primary headers of kpf objects, which are written to 2D, L1, and L2 FITS files (but not the L0 files, which, with rare exceptions, are not modified after data collection at WMKO). The FITS header keywords for QC tests produce are defined in :doc:data_format. One can find results from the QC tests from primary header keywords on the command line using a command like

fitsheader -e 0 /data/kpf/L2/20230701/KP.20230701.49940.99_L2.fits | grep QC:

The KPF DRP has several Quality Control (QC) methods that can be run on the L0, 2D, L1, and 2D objects. The QC tests are run during normal processing in the main recipe. The results of these QC checks are added to the primary headers of kpf objects, which are written to 2D, L1, and L2 FITS files (but not the L0 files, which with rare exceptions are not modified after data collection at WMKO).

One can also produce a ‘Quality Control Report’ for a given observation. The example below is for an Etalon exposure.

[1]:
import os
from modules.Utils.kpf_parse import get_kpf_data, HeaderParse
import modules.quality_control.src.quality_control as qc
from modules.quality_control.src.quality_control import execute_all_QCs
from IPython.display import display, HTML
from modules.Utils.kpf_parse import get_datecode
from kpfpipe.models.level2 import KPF2
from modules.quality_control.src.quality_control import *

ObsID = 'KP.20240426.51689.91' # Etalon exposure
#ObsID = 'KP.20240424.25862.05' # Star
L2_file = '/data/L2/' + get_datecode(ObsID) + '/' + ObsID + '_L2.fits'
L2 = KPF2.from_fits(L2_file)
QC_report(L2, print_output=True) # print results
Quality Control Report for KP.20240426.51689.91 (Etalon, L2)

  Keyword          Level    Description
✓ NOTJUNK          L0       File is not in list of junk files
✓ DATAPRL0         L0       Expected L0 data products present with non-zero array sizes
✓ KWRDPRL0         L0       Expected L0 header keywords present
✓ TIMCHKL0         L0       Timing consistency in L0 header keywords and ExpMeter table
✓ GOODREAD         L0       CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec)
✓ NTPGOOD          L0       NTP time accurate to within 100 ms
✓ AGITOK           L0       Agitator is running with speed above minimum
✗ ETASTEMP         L0       Etalon inner chamber temps near set points
✓ DATAPR2D         2D       Green and Red CCD data present with expected array sizes
✓ POS2DSNR         2D       Green and Red CCD data/variance^0.5 not significantly negative
✓ OLDBIAS          2D       Master bias from within 5 days of this observation
✓ OLDDARK          2D       Master dark from within 5 days of this observation
✓ OLDFLAT          2D       Master flat from within 5 days of this observation
✗ FLXSTATS         2D       2D flux not smeared in and out of order trace [not yet reliable]
✓ MONOTWLS         L1       Wavelength solution is monotonic
✓ DATAPRL1         L1       Green and Red data present in L1 with expected shapes
✓ WLSL1            L1       WLS files exist, are not the same, and bracket the observation
✓ OLDWLS           L1       WLSFILE from within 2 days of this observation
✓ OLDWLS2          L1       WLSFILE2 from within 2 days of this observation
✓ ETALINES         L1       Number and distribution of Etalon lines sufficient
✓ WILDWSCI         L1       Not wild SCI WLS (stdev < 5 pix in all orders compared to ref)
✓ WILDWSKY         L1       Not wild SKY WLS (stdev < 5 pix in all orders compared to ref)
✓ WILDWCAL         L1       Not wild CAL WLS (stdev < 5 pix in all orders compared to ref)
✓ OLDTRAC          L1       Trace file from within 5 days of this observation
✓ OLDLAMP          L1       Smooth lamp file from within 5 days of this observation
✓ TIMCHKL2         L2       Timing consistency in L2 files
✓ DATAPRL2         L2       All data present in L2

Pass/Fail, ✓ - keyword present, ✗ - keyword missing

The QC methods are defined in the QCDefinitions class in modules/quality_control/src/quality_control.py.

[2]:
myQCdef = qc.QCDefinitions()
QC_lists = myQCdef.list_qc_metrics()

# prevent scrolling in the resulting Notebook cell
display(HTML("<style>.output_scroll { height: auto !important; }</style>"))
Quality Control tests for L0:
   Name: not_junk
      Description: File is not in list of junk files
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: NOTJUNK
      Keyword fail value: 0
      Comment: QC: Not in list of junk files
      Database column: None

   Name: L0_data_products
      Description: Expected L0 data products present with non-zero array sizes
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: DATAPRL0
      Keyword fail value: 0
      Comment: QC: L0 data present
      Database column: None

   Name: L0_header_keywords_present
      Description: Expected L0 header keywords present
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: KWRDPRL0
      Keyword fail value: 0
      Comment: QC: L0 keywords present
      Database column: None

   Name: L0_datetime
      Description: Timing consistency in L0 header keywords and ExpMeter table
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): []
      Keyword: TIMCHKL0
      Keyword fail value: 0
      Comment: QC: L0 times consistent
      Database column: None

   Name: EM_not_saturated
      Description: 2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY
      Date levels: ['L0']
      Date type: int
      Required data products: ['ExpMeter']
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: EMSAT
      Keyword fail value: 0
      Comment: QC: EM not saturated
      Database column: None

   Name: EM_flux_not_negative
      Description: Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.
      Date levels: ['L0']
      Date type: int
      Required data products: ['ExpMeter']
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: EMNEG
      Keyword fail value: 0
      Comment: QC: EM not negative flux
      Database column: None

   Name: add_kpfera
      Description: Not a QC test; KPFERA keyword added to header
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: float
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: KPFERA
      Keyword fail value: -1
      Comment: Current era of KPF observations
      Database column: None

   Name: L0_good_readout
      Description: CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec)
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: GOODREAD
      Keyword fail value: 0
      Comment: QC: CCD read properly
      Database column: None

   Name: NTP_timing
      Description: NTP time accurate to within 100 ms
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: NTPGOOD
      Keyword fail value: 0
      Comment: QC: NTP time accurate to within 100 ms
      Database column: None

   Name: good_guiding
      Description: Guiding meets specs
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: GUIDGOOD
      Keyword fail value: 0
      Comment: QC: Guider RMS and bias within 50 mas RMS
      Database column: None

   Name: good_TARG_headers
      Description: TARG headers have plausible values
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: TARGPLAU
      Keyword fail value: 0
      Comment: QC: TARG kwds present with plausible values
      Database column: None

   Name: agitator_operating
      Description: Agitator is running with speed above minimum
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: AGITOK
      Keyword fail value: 0
      Comment: QC: Agitator running with speed above minimum
      Database column: None

   Name: guider_not_saturated
      Description: Guider avg frame not saturated and <10% of frames have a sat pixel
      Date levels: ['L0']
      Date type: int
      Required data products: ['Guider']
      Spectrum types (applied to): ['Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: GUIDSAT
      Keyword fail value: 0
      Comment: QC: Guider not saturated
      Database column: None

   Name: not_vignetting
      Description: Telescope not vignetted by dome/shutters
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: NOTVIGN
      Keyword fail value: 0
      Comment: QC: Telescope not vignetted by dome
      Database column: None

   Name: not_low_elevation
      Description: Telescope elevation above 30 deg (for ADC)
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: GOODEL
      Keyword fail value: 0
      Comment: QC: Telescope elevation above 30 deg (for ADC)
      Database column: None

   Name: etalon_set_temp
      Description: Etalon inner chamber temps near set points
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Etalon']
      Master types (required for): []
      Drift types (required for): []
      Keyword: ETASTEMP
      Keyword fail value: 0
      Comment: QC: Etalon at set temperature
      Database column: None

   Name: telemetry_present
      Description: TELEMETRY extension present in L0
      Date levels: ['L0']
      Date type: int
      Required data products: []
      Spectrum types (applied to): []
      Master types (required for): []
      Drift types (required for): []
      Keyword: TELEPRL0
      Keyword fail value: 0
      Comment: QC: TELEMETRY extension present in L0
      Database column: None

Quality Control tests for 2D:
   Name: not_junk
      Description: File is not in list of junk files
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: NOTJUNK
      Keyword fail value: 0
      Comment: QC: Not in list of junk files
      Database column: None

   Name: D2_lfc_flux
      Description: LFC frame that goes into a master has sufficient flux
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['LFC']
      Master types (required for): ['LFC']
      Drift types (required for): ['LFC']
      Keyword: LFC2DFOK
      Keyword fail value: 0
      Comment: QC: LFC flux meets threshold of 4000 counts
      Database column: None

   Name: data_2D_bias_low_flux
      Description: Flux is low in bias exposure
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Bias']
      Master types (required for): ['Bias']
      Drift types (required for): []
      Keyword: LOWBIAS
      Keyword fail value: 0
      Comment: QC: 2D bias low flux check
      Database column: None

   Name: data_2D_dark_low_flux
      Description: Flux is low in dark exposure
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Dark']
      Master types (required for): ['Dark']
      Drift types (required for): []
      Keyword: LOWDARK
      Keyword fail value: 0
      Comment: QC: 2D dark low flux check
      Database column: None

   Name: data_2D_CaHK
      Description: CaHK CCD data present with expected array sizes
      Date levels: ['2D']
      Date type: int
      Required data products: ['CaHK']
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: CAHKPR2D
      Keyword fail value: 0
      Comment: QC: 2D CaHK data present check
      Database column: None

   Name: data_2D_red_green
      Description: Green and Red CCD data present with expected array sizes
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: DATAPR2D
      Keyword fail value: 0
      Comment: QC: 2D red and green data present check
      Database column: None

   Name: positive_2D_SNR
      Description: Green and Red CCD data/variance^0.5 not significantly negative
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: POS2DSNR
      Keyword fail value: 0
      Comment: QC: 2D check for > 10% data 5-sigma below zero
      Database column: None

   Name: add_kpfera
      Description: Not a QC test; KPFERA keyword added to header
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: float
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: KPFERA
      Keyword fail value: -1
      Comment: Current era of KPF observations
      Database column: None

   Name: D2_master_bias_age
      Description: Master bias from within 5 days of this observation
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Dark', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDBIAS
      Keyword fail value: 0
      Comment: QC: Master bias within 5 days of this obs
      Database column: None

   Name: D2_master_dark_age
      Description: Master dark from within 5 days of this observation
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Bias', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDDARK
      Keyword fail value: 0
      Comment: QC: Master dark within 5 days of this obs
      Database column: None

   Name: D2_master_flat_age
      Description: Master flat from within 5 days of this observation
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Bias', 'Dark', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDFLAT
      Keyword fail value: 0
      Comment: QC: Master flat within 5 days of this obs
      Database column: None

   Name: flux_stats_2D
      Description: 2D flux not smeared in and out of order trace [not yet reliable]
      Date levels: ['2D']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['ThAr', 'Etalon', 'LFC', 'Flat', 'Star', 'Sun']
      Master types (required for): []
      Drift types (required for): []
      Keyword: FLXSTATS
      Keyword fail value: 0
      Comment: QC: 2D flux not smeared in and out of order trace [not yet reliable]
      Database column: None

Quality Control tests for L1:
   Name: not_junk
      Description: File is not in list of junk files
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: NOTJUNK
      Keyword fail value: 0
      Comment: QC: Not in list of junk files
      Database column: None

   Name: monotonic_wavelength_solution
      Description: Wavelength solution is monotonic
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: MONOTWLS
      Keyword fail value: 0
      Comment: QC: Monotonic wavelength solution
      Database column: None

   Name: data_L1_red_green
      Description: Green and Red data present in L1 with expected shapes
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): ['all']
      Keyword: DATAPRL1
      Keyword fail value: 0
      Comment: QC: L1 red and green data present check
      Database column: None

   Name: data_L1_CaHK
      Description: CaHK data present in L1 with expected shape
      Date levels: ['L1']
      Date type: int
      Required data products: ['CaHK']
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: CAHKPRL1
      Keyword fail value: 0
      Comment: QC: L1 CaHK present check
      Database column: None

   Name: add_kpfera
      Description: Not a QC test; KPFERA keyword added to header
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: float
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: KPFERA
      Keyword fail value: -1
      Comment: Current era of KPF observations
      Database column: None

   Name: L1_check_snr_lfc
      Description: LFC not saturated
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['LFC']
      Master types (required for): ['LFC']
      Drift types (required for): ['LFC']
      Keyword: LFCSAT
      Keyword fail value: 0
      Comment: QC: LFC not saturated
      Database column: None

   Name: L1_correct_wls_check
      Description: WLS files exist, are not the same, and bracket the observation
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: WLSL1
      Keyword fail value: 0
      Comment: QC: WLS files are correct in L1
      Database column: None

   Name: L1_WLSFILE_age
      Description: WLSFILE from within 2 days of this observation
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDWLS
      Keyword fail value: 0
      Comment: QC: WLSFILE within 2 days of this obs
      Database column: None

   Name: L1_WLSFILE2_age
      Description: WLSFILE2 from within 2 days of this observation
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDWLS2
      Keyword fail value: 0
      Comment: QC: WLSFILE2 within 2 days of this obs
      Database column: None

   Name: L1_FLAT_SNR
      Description: Flat SNR sufficient, all orders/orderlets
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Flat']
      Master types (required for): []
      Drift types (required for): []
      Keyword: FLATSNR
      Keyword fail value: 0
      Comment: QC: Flat SNR sufficient, all orders/orderlets
      Database column: None

   Name: L1_LFC_lines
      Description: Number and distribution of LFC lines sufficient
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['LFC']
      Master types (required for): []
      Drift types (required for): ['LFC']
      Keyword: LFCLINES
      Keyword fail value: 0
      Comment: QC: Number and dist of LFC lines sufficient
      Database column: None

   Name: L1_Etalon_lines
      Description: Number and distribution of Etalon lines sufficient
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Etalon']
      Master types (required for): []
      Drift types (required for): ['Etalon']
      Keyword: ETALINES
      Keyword fail value: 0
      Comment: QC: Number and dist of Etalon lines sufficient
      Database column: None

   Name: L1_wild_WLS_SCI
      Description: Not wild SCI WLS (stdev < 5 pix in all orders compared to ref)
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: WILDWSCI
      Keyword fail value: 0
      Comment: QC: SCI wavelength solution not wild
      Database column: None

   Name: L1_wild_WLS_SKY
      Description: Not wild SKY WLS (stdev < 5 pix in all orders compared to ref)
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: WILDWSKY
      Keyword fail value: 0
      Comment: QC: SKY wavelength solution not wild
      Database column: None

   Name: L1_wild_WLS_CAL
      Description: Not wild CAL WLS (stdev < 5 pix in all orders compared to ref)
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: WILDWCAL
      Keyword fail value: 0
      Comment: QC: CAL wavelength solution not wild
      Database column: None

   Name: trace_age
      Description: Trace file from within 5 days of this observation
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Dark', 'Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDTRAC
      Keyword fail value: 0
      Comment: QC: Trace file within 5 days of this obs
      Database column: None

   Name: smooth_lamp_age
      Description: Smooth lamp file from within 5 days of this observation
      Date levels: ['L1']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: OLDLAMP
      Keyword fail value: 0
      Comment: QC: Smooth lamp file within 5 days of this obs
      Database column: None

Quality Control tests for L2:
   Name: not_junk
      Description: File is not in list of junk files
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): ['all']
      Drift types (required for): ['all']
      Keyword: NOTJUNK
      Keyword fail value: 0
      Comment: QC: Not in list of junk files
      Database column: None

   Name: L2_datetime
      Description: Timing consistency in L2 files
      Date levels: ['L2']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: TIMCHKL2
      Keyword fail value: 0
      Comment: QC: L2 times consistent
      Database column: None

   Name: data_L2
      Description: All data present in L2
      Date levels: ['L2']
      Date type: int
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: DATAPRL2
      Keyword fail value: 0
      Comment: QC: L2 data present check
      Database column: None

   Name: add_kpfera
      Description: Not a QC test; KPFERA keyword added to header
      Date levels: ['L0', '2D', 'L1', 'L2']
      Date type: float
      Required data products: []
      Spectrum types (applied to): ['all']
      Master types (required for): []
      Drift types (required for): []
      Keyword: KPFERA
      Keyword fail value: -1
      Comment: Current era of KPF observations
      Database column: None

   Name: L2_barycentric_rv_percent_change
      Description: Non-zero-weight orders percent BCV values within an acceptable range.
      Date levels: ['L2']
      Date type: int
      Required data products: ['Green', 'Red']
      Spectrum types (applied to): ['Star']
      Master types (required for): []
      Drift types (required for): []
      Keyword: QCPCBCV
      Keyword fail value: 0
      Comment: QC: Percent BCV values within acceptable range
      Database column: None

The method test_all_QCs(kpf_object, data_level) runs the QC tests on a kpf_object for the stated data_level.

The method below checks if each QC keyword is listed in two places and prints the results with green and red highlighting. The two places are: 1) .yaml plot configuration files for the time series database, 2) .csv files that define the time series database structure. This is useful for debugging while developing new QC methods.

[3]:
myQCdef.search_for_QC_keywords_in_files()
Searching for *.yaml files in /code/KPF-Pipeline/static/tsdb_plot_configs/ for QC keywords.
Found 'NOTJUNK' from 'not_junk' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/junk_status.yaml
Found 'MONOTWLS' from 'monotonic_wavelength_solution' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_monotonic_wls.yaml
Found 'DATAPRL0' from 'L0_data_products' in: /code/KPF-Pipeline/static/tsdb_plot_configs/DRP/files_missing.yaml
Found 'DATAPRL0' from 'L0_data_products' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'KWRDPRL0' from 'L0_header_keywords_present' in: /code/KPF-Pipeline/static/tsdb_plot_configs/DRP/files_missing.yaml
Found 'KWRDPRL0' from 'L0_header_keywords_present' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/autocal-flat_snr_relative.yaml
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/good_orders_etalon.yaml
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/good_orders_lfc.yaml
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/autocal-flat_flux_relative.yaml
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/autocal-flat_snr.yaml
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_time_check.yaml
Found 'TIMCHKL2' from 'L2_datetime' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_time_check.yaml
Found 'EMSAT' from 'EM_not_saturated' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_em.yaml
Found 'EMNEG' from 'EM_flux_not_negative' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_em.yaml
Found 'LFC2DFOK' from 'D2_lfc_flux' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_lfc.yaml
Found 'LOWBIAS' from 'data_2D_bias_low_flux' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_low_flux.yaml
Found 'LOWDARK' from 'data_2D_dark_low_flux' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_low_flux.yaml
Found 'DATAPRL1' from 'data_L1_red_green' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'CAHKPRL1' from 'data_L1_CaHK' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'DATAPRL2' from 'data_L2' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'CAHKPR2D' from 'data_2D_CaHK' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'DATAPR2D' from 'data_2D_red_green' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'POS2DSNR' from 'positive_2D_SNR' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_pos_2d_snr.yaml
Found 'KPFERA' from 'add_kpfera' in: /code/KPF-Pipeline/static/tsdb_plot_configs/DRP/drptag.yaml
Found 'LFCSAT' from 'L1_check_snr_lfc' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_lfc.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/CCDs/ccd_dark_current.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/CCDs/ccd_readnoise.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/CCDs/xdisp_offset.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/autocal-flat_snr_relative.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/good_orders_etalon.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/good_orders_lfc.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/lamp_power.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/lfc.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/saturated_etalon.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/saturated_lfc.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/saturated_thar.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/autocal-flat_flux_relative.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/autocal-flat_snr.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/saturated_une.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/DRP/files_missing.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Observing/observing_snr.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/junk_status.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_goodread.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/RV/autocal_erv.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/RV/autocal_etalon_rv.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/RV/autocal_rv.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/RV/socal_rv.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/SoCal/socal_snr.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/WLS/wls_median.yaml
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_plot_configs/WLS/wls_stdev.yaml
Found 'WLSL1' from 'L1_correct_wls_check' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_wls.yaml
Found 'OLDBIAS' from 'D2_master_bias_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'OLDDARK' from 'D2_master_dark_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'OLDFLAT' from 'D2_master_flat_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'OLDWLS' from 'L1_WLSFILE_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'OLDWLS2' from 'L1_WLSFILE2_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'FLATSNR' from 'L1_FLAT_SNR' in: /code/KPF-Pipeline/static/tsdb_plot_configs/CCDs/xdisp_offset.yaml
Found 'FLATSNR' from 'L1_FLAT_SNR' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_flat.yaml
Found 'FLATSNR' from 'L1_FLAT_SNR' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_cals.yaml
Found 'LFCLINES' from 'L1_LFC_lines' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_lfc.yaml
Found 'ETALINES' from 'L1_Etalon_lines' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_etalon.yaml
Found 'WILDWSCI' from 'L1_wild_WLS_SCI' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_wls.yaml
Found 'WILDWSKY' from 'L1_wild_WLS_SKY' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_wls.yaml
Found 'WILDWCAL' from 'L1_wild_WLS_CAL' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_wls.yaml
Found 'NTPGOOD' from 'NTP_timing' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_ntp.yaml
Found 'GUIDGOOD' from 'good_guiding' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_guider.yaml
Found 'GUIDGOOD' from 'good_guiding' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_observing.yaml
Found 'TARGPLAU' from 'good_TARG_headers' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_kwds.yaml
No occurrence of 'L2_barycentric_rv_percent_change' => 'QCPCBCV' found in any .yaml file.
Found 'OLDTRAC' from 'trace_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'OLDLAMP' from 'smooth_lamp_age' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_master_age.yaml
Found 'AGITOK' from 'agitator_operating' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_agitator.yaml
Found 'GUIDSAT' from 'guider_not_saturated' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_guider.yaml
Found 'GUIDSAT' from 'guider_not_saturated' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_observing.yaml
Found 'NOTVIGN' from 'not_vignetting' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_observing.yaml
Found 'GOODEL' from 'not_low_elevation' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_observing.yaml
Found 'ETASTEMP' from 'etalon_set_temp' in: /code/KPF-Pipeline/static/tsdb_plot_configs/Cal/good_orders_etalon.yaml
Found 'ETASTEMP' from 'etalon_set_temp' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_etalon.yaml
Found 'TELEPRL0' from 'telemetry_present' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/qc_data_kwds.yaml
Found 'FLXSTATS' from 'flux_stats_2D' in: /code/KPF-Pipeline/static/tsdb_plot_configs/QC/junk_status.yaml

Searching for *.csv files in /code/KPF-Pipeline/static/tsdb_tables/ for QC keywords.
Found 'NOTJUNK' from 'not_junk' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'NOTJUNK' from 'not_junk' in: /code/KPF-Pipeline/static/tsdb_tables/indexed_columns.csv
Found 'MONOTWLS' from 'monotonic_wavelength_solution' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'DATAPRL0' from 'L0_data_products' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'KWRDPRL0' from 'L0_header_keywords_present' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'TIMCHKL0' from 'L0_datetime' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'TIMCHKL2' from 'L2_datetime' in: /code/KPF-Pipeline/static/tsdb_tables/l2_primary.csv
Found 'EMSAT' from 'EM_not_saturated' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'EMNEG' from 'EM_flux_not_negative' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'LFC2DFOK' from 'D2_lfc_flux' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'LOWBIAS' from 'data_2D_bias_low_flux' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'LOWDARK' from 'data_2D_dark_low_flux' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'DATAPRL1' from 'data_L1_red_green' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'CAHKPRL1' from 'data_L1_CaHK' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'DATAPRL2' from 'data_L2' in: /code/KPF-Pipeline/static/tsdb_tables/l2_primary.csv
Found 'CAHKPR2D' from 'data_2D_CaHK' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'DATAPR2D' from 'data_2D_red_green' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'POS2DSNR' from 'positive_2D_SNR' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'KPFERA' from 'add_kpfera' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'KPFERA' from 'add_kpfera' in: /code/KPF-Pipeline/static/tsdb_tables/indexed_columns.csv
Found 'LFCSAT' from 'L1_check_snr_lfc' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'GOODREAD' from 'L0_good_readout' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'WLSL1' from 'L1_correct_wls_check' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'OLDBIAS' from 'D2_master_bias_age' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'OLDDARK' from 'D2_master_dark_age' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'OLDFLAT' from 'D2_master_flat_age' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'OLDWLS' from 'L1_WLSFILE_age' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'OLDWLS2' from 'L1_WLSFILE2_age' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'FLATSNR' from 'L1_FLAT_SNR' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'LFCLINES' from 'L1_LFC_lines' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'ETALINES' from 'L1_Etalon_lines' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'WILDWSCI' from 'L1_wild_WLS_SCI' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'WILDWSKY' from 'L1_wild_WLS_SKY' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'WILDWCAL' from 'L1_wild_WLS_CAL' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'NTPGOOD' from 'NTP_timing' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'GUIDGOOD' from 'good_guiding' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'TARGPLAU' from 'good_TARG_headers' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'QCPCBCV' from 'L2_barycentric_rv_percent_change' in: /code/KPF-Pipeline/static/tsdb_tables/l2_primary.csv
Found 'OLDTRAC' from 'trace_age' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'OLDLAMP' from 'smooth_lamp_age' in: /code/KPF-Pipeline/static/tsdb_tables/l1_primary.csv
Found 'AGITOK' from 'agitator_operating' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'GUIDSAT' from 'guider_not_saturated' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'NOTVIGN' from 'not_vignetting' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'GOODEL' from 'not_low_elevation' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'ETASTEMP' from 'etalon_set_temp' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'TELEPRL0' from 'telemetry_present' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv
Found 'FLXSTATS' from 'flux_stats_2D' in: /code/KPF-Pipeline/static/tsdb_tables/d2_primary.csv

[4]:
ObsID = 'KP.20230701.49940.99' # 185144 (stellar observation)
data_level = 'L2'
if os.path.isfile(get_kpf_data(ObsID, data_level, return_kpf_object=False)):
    print(f'\033[1m{data_level} QC tests on {ObsID}\033[0m')
    print(f'\033[1m***********************************\033[0m')
    kpf_object = get_kpf_data(ObsID, data_level)
    junk = execute_all_QCs(kpf_object, data_level)
L2 QC tests on KP.20230701.49940.99
***********************************
INFO: Spectrum type: Star
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=1.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because ['Green', 'Red'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green CCF', 'Green CCF RW', 'Red CCF', 'Red CCF RW', 'RV'])

Now loop over data levels and obserations

[5]:
# Define data levels to loop over
data_levels = ['L0', '2D', 'L1', 'L2']

# Define list of observations to loop over - one of every spectrum type
ObsIDs = [
          'KP.20230701.49940.99', # 185144 (stellar observation)
          'KP.20240525.77699.94', # Socal
          'KP.20240528.04120.26', # autocal-bias
          'KP.20240528.08502.04', # autocal-dark
          'KP.20240527.84455.02', # autocal-flat-all
          'KP.20240526.11989.38', # autocal-lfc-all-eve
          'KP.20240528.07447.61', # autocal-thar-all-eve
          'KP.20240527.11183.00', # autocal-une-all-eve
          'KP.20240528.05681.26', # autocal-etalon-all-eve
          'KP.20240527.51851.54', # autocal-etalon-all-night
          'KP.20240528.07772.51', # autocal-thar-hk
         ]

# Run QC tests
for ObsID in ObsIDs:
    for data_level in data_levels:
        if os.path.isfile(get_kpf_data(ObsID, data_level, return_kpf_object=False)):
            print(f'\033[1m{data_level} QC tests on {ObsID}\033[0m')
            print(f'\033[1m***********************************\033[0m')
            kpf_object = get_kpf_data(ObsID, data_level)
            junk = execute_all_QCs(kpf_object, data_level)
            print()

# prevent scrolling in the resulting Notebook cell
display(HTML("<style>.output_scroll { height: auto !important; }</style>"))
L0 QC tests on KP.20230701.49940.99
***********************************
INFO: Spectrum type: Star
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: QC: EM_not_saturated (EMSAT; 2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY)
INFO: QC result: True (True = pass)
INFO: QC: EM_flux_not_negative (EMNEG; Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=1.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: QC: good_guiding (GUIDGOOD; Guiding meets specs)
INFO: Exception: 'KPF0' object has no attribute 'GUIDER_AVG'
INFO: QC result: False (True = pass)
INFO: QC: good_TARG_headers (TARGPLAU; TARG headers have plausible values)
INFO: QC result: True (True = pass)
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: QC: guider_not_saturated (GUIDSAT; Guider avg frame not saturated and <10% of frames have a sat pixel)
INFO: Exception: 'KPF0' object has no attribute 'GUIDER_AVG'
INFO: QC result: False (True = pass)
INFO: QC: not_vignetting (NOTVIGN; Telescope not vignetted by dome/shutters)
INFO: QC result: True (True = pass)
INFO: QC: not_low_elevation (GOODEL; Telescope elevation above 30 deg (for ADC))
INFO: QC result: True (True = pass)
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because Star not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Star not in list of spectrum types: []

2D QC tests on KP.20230701.49940.99
***********************************
INFO: Spectrum type: Star
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Star not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because Star not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because Star not in list of spectrum types: ['Dark']
INFO: Not running QC: data_2D_CaHK (CaHK CCD data present with expected array sizes) because ['CaHK'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green', 'Red', 'ExpMeter', 'Guider'])
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=1.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20230701.49940.99
***********************************
INFO: Spectrum type: Star
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: Not running QC: data_L1_CaHK (CaHK data present in L1 with expected shape) because ['CaHK'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green', 'Red', 'BC'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=1.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Star not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because Star not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Star not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because Star not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20230701.49940.99
***********************************
INFO: Spectrum type: Star
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=1.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because ['Green', 'Red'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green CCF', 'Green CCF RW', 'Red CCF', 'Red CCF RW', 'RV'])

L0 QC tests on KP.20240525.77699.94
***********************************
INFO: Spectrum type: Sun
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'Pyrheliometer'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'Pyrheliometer'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because Sun not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because Sun not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because Sun not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because Sun not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because Sun not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because Sun not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Sun not in list of spectrum types: []

2D QC tests on KP.20240525.77699.94
***********************************
INFO: Spectrum type: Sun
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Sun not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because Sun not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because Sun not in list of spectrum types: ['Dark']
INFO: Not running QC: data_2D_CaHK (CaHK CCD data present with expected array sizes) because ['CaHK'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green', 'Red', 'Pyrheliometer'])
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20240525.77699.94
***********************************
INFO: Spectrum type: Sun
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: Not running QC: data_L1_CaHK (CaHK data present in L1 with expected shape) because ['CaHK'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green', 'Red'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Sun not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because Sun not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Sun not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because Sun not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240525.77699.94
***********************************
INFO: Spectrum type: Sun
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because Sun not in list of spectrum types: ['Star']

L0 QC tests on KP.20240528.04120.26
***********************************
INFO: Spectrum type: Bias
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because Bias not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because Bias not in list of spectrum types: ['Star']
INFO: Not running QC: agitator_operating (Agitator is running with speed above minimum) because Bias not in list of spectrum types: ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because Bias not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because Bias not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because Bias not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because Bias not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Bias not in list of spectrum types: []

2D QC tests on KP.20240528.04120.26
***********************************
INFO: Spectrum type: Bias
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Bias not in list of spectrum types: ['LFC']
INFO: QC: data_2D_bias_low_flux (LOWBIAS; Flux is low in bias exposure)
INFO: QC result: True (True = pass)
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because Bias not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: D2_master_bias_age (Master bias from within 5 days of this observation) because Bias not in list of spectrum types: ['Dark', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: flux_stats_2D (2D flux not smeared in and out of order trace [not yet reliable]) because Bias not in list of spectrum types: ['ThAr', 'Etalon', 'LFC', 'Flat', 'Star', 'Sun']

L1 QC tests on KP.20240528.04120.26
***********************************
INFO: Spectrum type: Bias
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Bias not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because Bias not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Bias not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because Bias not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: Not running QC: trace_age (Trace file from within 5 days of this observation) because Bias not in list of spectrum types: ['Dark', 'Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: smooth_lamp_age (Smooth lamp file from within 5 days of this observation) because Bias not in list of spectrum types: ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']

L0 QC tests on KP.20240528.08502.04
***********************************
INFO: Spectrum type: Dark
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because Dark not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because Dark not in list of spectrum types: ['Star']
INFO: Not running QC: agitator_operating (Agitator is running with speed above minimum) because Dark not in list of spectrum types: ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because Dark not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because Dark not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because Dark not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because Dark not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Dark not in list of spectrum types: []

2D QC tests on KP.20240528.08502.04
***********************************
INFO: Spectrum type: Dark
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Dark not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because Dark not in list of spectrum types: ['Bias']
INFO: QC: data_2D_dark_low_flux (LOWDARK; Flux is low in dark exposure)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_master_dark_age (Master dark from within 5 days of this observation) because Dark not in list of spectrum types: ['Bias', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: flux_stats_2D (2D flux not smeared in and out of order trace [not yet reliable]) because Dark not in list of spectrum types: ['ThAr', 'Etalon', 'LFC', 'Flat', 'Star', 'Sun']

L1 QC tests on KP.20240528.08502.04
***********************************
INFO: Spectrum type: Dark
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Dark not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because Dark not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Dark not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because Dark not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: Not running QC: smooth_lamp_age (Smooth lamp file from within 5 days of this observation) because Dark not in list of spectrum types: ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']

L0 QC tests on KP.20240527.84455.02
***********************************
INFO: Spectrum type: Flat
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because Flat not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because Flat not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because Flat not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because Flat not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because Flat not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because Flat not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Flat not in list of spectrum types: []

2D QC tests on KP.20240527.84455.02
***********************************
INFO: Spectrum type: Flat
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Flat not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because Flat not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because Flat not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_master_flat_age (Master flat from within 5 days of this observation) because Flat not in list of spectrum types: ['Bias', 'Dark', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20240527.84455.02
***********************************
INFO: Spectrum type: Flat
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Flat not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_FLAT_SNR (FLATSNR; Flat SNR sufficient, all orders/orderlets)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Flat not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because Flat not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240527.84455.02
***********************************
INFO: Spectrum type: Flat
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because Flat not in list of spectrum types: ['Star']

L0 QC tests on KP.20240526.11989.38
***********************************
INFO: Spectrum type: LFC
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because LFC not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because LFC not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because LFC not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because LFC not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because LFC not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because LFC not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because LFC not in list of spectrum types: []

2D QC tests on KP.20240526.11989.38
***********************************
INFO: Spectrum type: LFC
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: D2_lfc_flux (LFC2DFOK; LFC frame that goes into a master has sufficient flux)
INFO: QC result: True (True = pass)
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because LFC not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because LFC not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20240526.11989.38
***********************************
INFO: Spectrum type: LFC
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L1_check_snr_lfc (LFCSAT; LFC not saturated)
INFO: QC result: True (True = pass)
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: False (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because LFC not in list of spectrum types: ['Flat']
INFO: QC: L1_LFC_lines (LFCLINES; Number and distribution of LFC lines sufficient)
INFO: QC result: False (True = pass)
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because LFC not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240526.11989.38
***********************************
INFO: Spectrum type: LFC
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because LFC not in list of spectrum types: ['Star']

L0 QC tests on KP.20240528.07447.61
***********************************
INFO: Spectrum type: ThAr
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because ThAr not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because ThAr not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because ThAr not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because ThAr not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because ThAr not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because ThAr not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because ThAr not in list of spectrum types: []

2D QC tests on KP.20240528.07447.61
***********************************
INFO: Spectrum type: ThAr
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because ThAr not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because ThAr not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because ThAr not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20240528.07447.61
***********************************
INFO: Spectrum type: ThAr
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because ThAr not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because ThAr not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because ThAr not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because ThAr not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240528.07447.61
***********************************
INFO: Spectrum type: ThAr
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because ThAr not in list of spectrum types: ['Star']

L0 QC tests on KP.20240527.11183.00
***********************************
INFO: Spectrum type: UNe
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because UNe not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because UNe not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because UNe not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because UNe not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because UNe not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because UNe not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because UNe not in list of spectrum types: []

2D QC tests on KP.20240527.11183.00
***********************************
INFO: Spectrum type: UNe
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because UNe not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because UNe not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because UNe not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: flux_stats_2D (2D flux not smeared in and out of order trace [not yet reliable]) because UNe not in list of spectrum types: ['ThAr', 'Etalon', 'LFC', 'Flat', 'Star', 'Sun']

L1 QC tests on KP.20240527.11183.00
***********************************
INFO: Spectrum type: UNe
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because UNe not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: False (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because UNe not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because UNe not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because UNe not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240527.11183.00
***********************************
INFO: Spectrum type: UNe
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because UNe not in list of spectrum types: ['Star']

L0 QC tests on KP.20240528.05681.26
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because Etalon not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because Etalon not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because Etalon not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because Etalon not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because Etalon not in list of spectrum types: ['Star']
INFO: QC: etalon_set_temp (ETASTEMP; Etalon inner chamber temps near set points)
INFO: QC result: True (True = pass)
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Etalon not in list of spectrum types: []

2D QC tests on KP.20240528.05681.26
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Etalon not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because Etalon not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because Etalon not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20240528.05681.26
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Etalon not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because Etalon not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Etalon not in list of spectrum types: ['LFC']
INFO: QC: L1_Etalon_lines (ETALINES; Number and distribution of Etalon lines sufficient)
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240528.05681.26
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because Etalon not in list of spectrum types: ['Star']

L0 QC tests on KP.20240527.51851.54
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because Etalon not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because Etalon not in list of spectrum types: ['Star']
INFO: QC: agitator_operating (AGITOK; Agitator is running with speed above minimum)
INFO: QC result: True (True = pass)
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because Etalon not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because Etalon not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because Etalon not in list of spectrum types: ['Star']
INFO: QC: etalon_set_temp (ETASTEMP; Etalon inner chamber temps near set points)
INFO: QC result: True (True = pass)
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because Etalon not in list of spectrum types: []

2D QC tests on KP.20240527.51851.54
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because Etalon not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because Etalon not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because Etalon not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: D2_master_bias_age (OLDBIAS; Master bias from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_dark_age (OLDDARK; Master dark from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: D2_master_flat_age (OLDFLAT; Master flat from within 5 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: flux_stats_2D (FLXSTATS; 2D flux not smeared in and out of order trace [not yet reliable])
INFO: QC result: True (True = pass)

L1 QC tests on KP.20240527.51851.54
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because Etalon not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: False (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because Etalon not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because Etalon not in list of spectrum types: ['LFC']
INFO: QC: L1_Etalon_lines (ETALINES; Number and distribution of Etalon lines sufficient)
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: trace_age (OLDTRAC; Trace file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)
INFO: QC: smooth_lamp_age (OLDLAMP; Smooth lamp file from within 5 days of this observation)
INFO: Exception: 'AnalyzeL1' object has no attribute 'measure_master_age'
INFO: QC result: False (True = pass)

L2 QC tests on KP.20240527.51851.54
***********************************
INFO: Spectrum type: Etalon
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because Etalon not in list of spectrum types: ['Star']

L0 QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes)
INFO: QC result: True (True = pass)
INFO: QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present)
INFO: QC result: True (True = pass)
INFO: QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: QC: L0_good_readout (GOODREAD; CCD read properly (Texp !≈ 6 sec and Texp_desired > 7 sec))
INFO: QC result: True (True = pass)
INFO: QC: NTP_timing (NTPGOOD; NTP time accurate to within 100 ms)
INFO: QC result: True (True = pass)
INFO: Not running QC: good_guiding (Guiding meets specs) because  not in list of spectrum types: ['Star']
INFO: Not running QC: good_TARG_headers (TARG headers have plausible values) because  not in list of spectrum types: ['Star']
INFO: Not running QC: agitator_operating (Agitator is running with speed above minimum) because  not in list of spectrum types: ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: guider_not_saturated (Guider avg frame not saturated and <10% of frames have a sat pixel) because  not in list of spectrum types: ['Star']
INFO: Not running QC: not_vignetting (Telescope not vignetted by dome/shutters) because  not in list of spectrum types: ['Star']
INFO: Not running QC: not_low_elevation (Telescope elevation above 30 deg (for ADC)) because  not in list of spectrum types: ['Star']
INFO: Not running QC: etalon_set_temp (Etalon inner chamber temps near set points) because  not in list of spectrum types: ['Etalon']
INFO: Not running QC: telemetry_present (TELEMETRY extension present in L0) because  not in list of spectrum types: []

2D QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because  not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure) because  not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure) because  not in list of spectrum types: ['Dark']
INFO: QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: data_2D_red_green (DATAPR2D; Green and Red CCD data present with expected array sizes)
INFO: QC result: True (True = pass)
INFO: QC: positive_2D_SNR (POS2DSNR; Green and Red CCD data/variance^0.5 not significantly negative)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: D2_master_bias_age (Master bias from within 5 days of this observation) because  not in list of spectrum types: ['Dark', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: D2_master_dark_age (Master dark from within 5 days of this observation) because  not in list of spectrum types: ['Bias', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: D2_master_flat_age (Master flat from within 5 days of this observation) because  not in list of spectrum types: ['Bias', 'Dark', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: flux_stats_2D (2D flux not smeared in and out of order trace [not yet reliable]) because  not in list of spectrum types: ['ThAr', 'Etalon', 'LFC', 'Flat', 'Star', 'Sun']

L1 QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_red_green (DATAPRL1; Green and Red data present in L1 with expected shapes)
INFO: QC result: True (True = pass)
INFO: QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (LFC not saturated) because  not in list of spectrum types: ['LFC']
INFO: QC: L1_correct_wls_check (WLSL1; WLS files exist, are not the same, and bracket the observation)
INFO: QC result: False (True = pass)
INFO: QC: L1_WLSFILE_age (OLDWLS; WLSFILE from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: QC: L1_WLSFILE2_age (OLDWLS2; WLSFILE2 from within 2 days of this observation)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Flat SNR sufficient, all orders/orderlets) because  not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Number and distribution of LFC lines sufficient) because  not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Number and distribution of Etalon lines sufficient) because  not in list of spectrum types: ['Etalon']
INFO: QC: L1_wild_WLS_SCI (WILDWSCI; Not wild SCI WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_SKY (WILDWSKY; Not wild SKY WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: QC: L1_wild_WLS_CAL (WILDWCAL; Not wild CAL WLS (stdev < 5 pix in all orders compared to ref))
INFO: QC result: True (True = pass)
INFO: Not running QC: trace_age (Trace file from within 5 days of this observation) because  not in list of spectrum types: ['Dark', 'Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: smooth_lamp_age (Smooth lamp file from within 5 days of this observation) because  not in list of spectrum types: ['Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']

L2 QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: QC: not_junk (NOTJUNK; File is not in list of junk files)
INFO: QC result: True (True = pass)
INFO: QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files)
INFO: QC result: True (True = pass)
INFO: QC: data_L2 (DATAPRL2; All data present in L2)
INFO: QC result: True (True = pass)
INFO: QC: add_kpfera (KPFERA; Not a QC test; KPFERA keyword added to header)
INFO: Result: KPFERA=2.0
INFO: Not running QC: L2_barycentric_rv_percent_change (Non-zero-weight orders percent BCV values within an acceptable range.) because  not in list of spectrum types: ['Star']

INFO: Spectrum type: Etalon
INFO: Running QC: not_junk (NOTJUNK; File is not in list of junk files.)
INFO: QC result: True (True = pass)
INFO: Running QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_L1_red_green (DATAPRL1; Red/Green data present in L1 with expected shapes.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape.)
INFO: QC result: True (True = pass)
INFO: Running QC: add_kpfera (KPFERA; Not a QC test; used to add the KPFERA keyword to header.)
INFO: The datetime of ObsID is 2024-05-27 14:24:11.
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (Check for saturated LFC frames.) because Etalon not in list of spectrum types: ['LFC']
INFO: Running QC: L1_correct_wls_check (WLSL1; Check WLS files used by L1 file)
INFO: QC result: False (True = pass)
INFO: Running QC: L1_WLSFILE_age (OLDWLS; Check WLSFILE file age)
INFO: QC result: True (True = pass)
INFO: Running QC: L1_WLSFILE2_age (OLDWLS2; Check WLSFILE2 file age)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Check SNR of flat) because Etalon not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Check number and distribution of LFC lines/order) because Etalon not in list of spectrum types: ['LFC']
INFO: Running QC: L1_Etalon_lines (ETALINES; Check number and distribution of Etalon lines/order)
INFO: QC result: True (True = pass)

L2 QC tests on KP.20240527.51851.54
***********************************
INFO: Spectrum type: Etalon
INFO: Running QC: not_junk (NOTJUNK; File is not in list of junk files.)
INFO: QC result: True (True = pass)
INFO: Running QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_L2 (DATAPRL2; All data present in L2.)
INFO: QC result: True (True = pass)
INFO: Running QC: add_kpfera (KPFERA; Not a QC test; used to add the KPFERA keyword to header.)
INFO: The datetime of ObsID is 2024-05-27 14:24:11.
INFO: Result: KPFERA=2.0

L0 QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: Running QC: not_junk (NOTJUNK; File is not in list of junk files.)
INFO: QC result: True (True = pass)
INFO: Running QC: L0_data_products (DATAPRL0; Expected L0 data products present with non-zero array sizes.)
INFO: Data products expected in this L0 file: ['Green', 'Red', 'Ca_HK', 'Telemetry']
INFO: Data products in L0 file: ['Green', 'Red', 'HK', 'Telemetry']
INFO: Possible data products in L0 file: ['Green', 'Red', 'CaHK', 'ExpMeter', 'Guider', 'Telemetry', 'Pyrheliometer']
INFO: QC result: True (True = pass)
INFO: Running QC: L0_header_keywords_present (KWRDPRL0; Expected L0 header keywords present.)
INFO: QC result: True (True = pass)
INFO: Running QC: L0_datetime (TIMCHKL0; Timing consistency in L0 header keywords and ExpMeter table.)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Green', 'Red', 'CaHK'])
INFO: Running QC: add_kpfera (KPFERA; Not a QC test; used to add the KPFERA keyword to header.)
INFO: The datetime of ObsID is 2024-05-28 02:09:32.
INFO: Result: KPFERA=2.0
INFO: Running QC: L0_bad_readout_check (GOODREAD; Check Texp that identifies error in reading CCD)
INFO: QC result: True (True = pass)

2D QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: Running QC: not_junk (NOTJUNK; File is not in list of junk files.)
INFO: QC result: True (True = pass)
INFO: Not running QC: EM_not_saturated (2+ reduced EM pixels within 90% of saturation in EM-SCI or EM-SKY.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: EM_flux_not_negative (Negative flux in the EM-SCI and EM-SKY by looking for 20 consecuitive pixels in the summed spectra with negative flux.) because ['ExpMeter'] not in list of expected data products(['Telemetry', 'Config', 'Receipt', 'Green', 'Red', 'CaHK'])
INFO: Not running QC: D2_lfc_flux (LFC frame that goes into a master has sufficient flux) because  not in list of spectrum types: ['LFC']
INFO: Not running QC: data_2D_bias_low_flux (Flux is low in bias exposure.) because  not in list of spectrum types: ['Bias']
INFO: Not running QC: data_2D_dark_low_flux (Flux is low in dark exposure.) because  not in list of spectrum types: ['Dark']
INFO: Running QC: data_2D_CaHK (CAHKPR2D; CaHK CCD data present with expected array sizes.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_2D_red_green (DATAPR2D; Red/Green CCD data present with expected array sizes.)
INFO: QC result: True (True = pass)
INFO: Running QC: positive_2D_SNR (POS2DSNR; Red/Green CCD data/var^0.5 not significantly negative.)
INFO: QC result: True (True = pass)
INFO: Running QC: add_kpfera (KPFERA; Not a QC test; used to add the KPFERA keyword to header.)
INFO: The datetime of ObsID is 2024-05-28 02:09:32.
INFO: Result: KPFERA=2.0
INFO: Running QC: L0_bad_readout_check (GOODREAD; Check Texp that identifies error in reading CCD)
INFO: Method L0_bad_readout_check does not exist in qc_obj or another AttributeError occurred: 'QC2D' object has no attribute 'L0_bad_readout_check'
INFO: Not running QC: D2_master_bias_age (Check master dark file age) because  not in list of spectrum types: ['Dark', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: D2_master_dark_age (Check master dark file age) because  not in list of spectrum types: ['Bias', 'Flat', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']
INFO: Not running QC: D2_master_flat_age (Check master flat file age) because  not in list of spectrum types: ['Bias', 'Dark', 'Wide Flat', 'LFC', 'Etalon', 'ThAr', 'UNe', 'Sun', 'Star']

L1 QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: Running QC: not_junk (NOTJUNK; File is not in list of junk files.)
INFO: QC result: True (True = pass)
INFO: Running QC: monotonic_wavelength_solution (MONOTWLS; Wavelength solution is monotonic.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_L1_red_green (DATAPRL1; Red/Green data present in L1 with expected shapes.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_L1_CaHK (CAHKPRL1; CaHK data present in L1 with expected shape.)
INFO: QC result: True (True = pass)
INFO: Running QC: add_kpfera (KPFERA; Not a QC test; used to add the KPFERA keyword to header.)
INFO: The datetime of ObsID is 2024-05-28 02:09:32.
INFO: Result: KPFERA=2.0
INFO: Not running QC: L1_check_snr_lfc (Check for saturated LFC frames.) because  not in list of spectrum types: ['LFC']
INFO: Running QC: L1_correct_wls_check (WLSL1; Check WLS files used by L1 file)
INFO: QC result: False (True = pass)
INFO: Running QC: L1_WLSFILE_age (OLDWLS; Check WLSFILE file age)
INFO: QC result: True (True = pass)
INFO: Running QC: L1_WLSFILE2_age (OLDWLS2; Check WLSFILE2 file age)
INFO: QC result: True (True = pass)
INFO: Not running QC: L1_FLAT_SNR (Check SNR of flat) because  not in list of spectrum types: ['Flat']
INFO: Not running QC: L1_LFC_lines (Check number and distribution of LFC lines/order) because  not in list of spectrum types: ['LFC']
INFO: Not running QC: L1_Etalon_lines (Check number and distribution of Etalon lines/order) because  not in list of spectrum types: ['Etalon']

L2 QC tests on KP.20240528.07772.51
***********************************
INFO: Spectrum type:
INFO: Running QC: not_junk (NOTJUNK; File is not in list of junk files.)
INFO: QC result: True (True = pass)
INFO: Running QC: L2_datetime (TIMCHKL2; Timing consistency in L2 files.)
INFO: QC result: True (True = pass)
INFO: Running QC: data_L2 (DATAPRL2; All data present in L2.)
INFO: QC result: True (True = pass)
INFO: Running QC: add_kpfera (KPFERA; Not a QC test; used to add the KPFERA keyword to header.)
INFO: The datetime of ObsID is 2024-05-28 02:09:32.
INFO: Result: KPFERA=2.0