quality_control.checkpoints
- class kpfpipe.quality_control.checkpoints.Checkpoint(kpf_obj)
Bases:
objectBase runner for per-level checkpoint methods.
- Parameters:
kpf_obj (KPFDataModel) – Finished data product whose flags/headers are read (never written).
- DIAGNOSTICS = None
- LEVEL = None
- QC = None
- RAISE_FLAGS = ()
- qc_flags()
Read this level’s 0/1 QC flags; raise a RAISE_FLAGS failure, warn the rest.
Scoped to this level’s own checks (the registry’s
qc_flag_keywords_by_level[LEVEL]– theQCL{n}flags), NOT the flags propagated from lower levels: QUALITY_CONTROL accumulates the whole L0->L1->L2->L4 history, but a lower-level flag was already surfaced at its own level’s checkpoint, so re-warning it here would just be noise. A flag absent from the header is skipped (the check did not run); a flag equal to 0 raises if it is inRAISE_FLAGS, else warns.
- run()
Run the paired Diagnostics and QC, then every checkpoint method.
Folds in the two upstream read-only stages: Diagnostics writes its metrics, QC writes the 0/1 flags + ISGOOD (captured in
self.qc_resultsfor callers that report them), then each checkpoint method warns or raises. A level with no pairedDIAGNOSTICS/QCskips that stage. The checkpoint methods themselves never write (no return value).
- unregistered_keywords()
Raise on any non-structural card not registered for its extension.
For each registry-governed extension present on the product (PRIMARY only where it is EPRV-standard – L1 onward; the raw WMKO L0 PRIMARY is skipped), a card that is neither structural nor registered (in
keyword_registry.allowed[ext]) raisesValueErrorand names it. This subsumes the old WMKO-native leak check: a raw instrument keyword kept in INSTRUMENT_HEADER is simply unregistered for an EPRV PRIMARY.
- class kpfpipe.quality_control.checkpoints.CheckpointL0(kpf_obj)
Bases:
CheckpointCheckpoints for KPF Level 0 raw data products.
The raw WMKO L0 PRIMARY is not registry-governed, so
unregistered_keywordsskips it and validates only the KPF-custom extensions (QUALITY_CONTROL, RECEIPT) present on the product.- LEVEL = 'L0'
- RAISE_FLAGS = ('DATAPRL0',)
- class kpfpipe.quality_control.checkpoints.CheckpointL1(kpf_obj)
Bases:
CheckpointCheckpoints for KPF Level 1 assembled FFI products.
- LEVEL = 'L1'
- RAISE_FLAGS = ('DATAPRL1',)
- class kpfpipe.quality_control.checkpoints.CheckpointL2(kpf_obj)
Bases:
CheckpointCheckpoints for KPF Level 2 extracted spectra products.
- LEVEL = 'L2'
- RAISE_FLAGS = ('DATAPRL2',)
- class kpfpipe.quality_control.checkpoints.CheckpointL4(kpf_obj)
Bases:
CheckpointCheckpoints for KPF Level 4 RV/CCF products.
- LEVEL = 'L4'
- RAISE_FLAGS = ('DATAPRL4',)
Submodules
Checkpoint framework base class. |
|
Checkpoints for KPF Level 0 (raw CCD) data products. |
|
Checkpoints for KPF Level 1 (assembled FFI) data products. |
|
Checkpoints for KPF Level 2 (extracted spectra) data products. |
|
Checkpoints for KPF Level 4 (RVs and CCFs) data products. |