quality_control.quicklook.level4
L4 quicklook plots for KPF cross-correlation functions (CCFs) and RVs.
Ports the per-order CCF grid from the v2.12 AnalyzeL2 class (the old
pipeline’s “L2” level is vNext’s L4: CCFs and RVs live in the L4 product).
The CCF grid shows, for each illuminated orderlet, every order’s CCF stacked
vertically so the per-order consistency of the dip is visible at a glance.
Pure visualization — no science computation is written back to the product.
- class kpfpipe.quality_control.quicklook.level4.PlotL4(l4_obj, output_dir=None, obs_id=None)
Bases:
objectQuicklook plots for KPF L4 (RVs and CCFs) data.
- Parameters:
l4_obj – KPF4 data object (post-CrossCorrelation + RadialVelocity).
output_dir – directory to save PNG files. None = return Figure only.
obs_id – observation ID for titles/filenames. If None, falls back to the l4_obj.obs_id attribute (populated on every construction path).
- ccf_grid(chip)
Per-orderlet CCF grid for one chip, matching the v2.12 plot_CCF_grid layout: five panels (SCI1, SCI2, SCI3, CAL, SKY), each order’s CCF normalized and offset, colored by the default cycle and labeled by order index. SCI panels add the combined-RV line + value and per-order delta-RV / weight columns. Returns None if the chip has no CCF data.
- run(which)
Generate the requested plot(s) for every chip that has CCF data, saving each to
output_dir. In that save-to-disk mode the figure is closed so callers don’t accumulate them; whenoutput_diris None the figures are returned open, so they display when the caller renders them (e.g. interactively in a notebook).- Parameters:
which – ‘all’ to run every implemented plot, or the name of a single plot method (one of
self._PLOT_METHODS).- Returns:
dict mapping
{method_name}_{chip}to matplotlib.Figure (closed only when saved tooutput_dir; useful for tests/introspection).