quality_control.quicklook.level1

L1 quicklook plots for assembled FFI.

class kpfpipe.quality_control.quicklook.level1.PlotL1(l1_obj, output_dir=None, full_res=False)

Bases: object

Quicklook plots for KPF L1 (assembled FFI) data.

Takes a KPF1 object and generates plots of the assembled detector image. Pure visualization — no science computation. Read-noise header mapping is imported from ImageAssembly so there is one source of truth for which FITS keywords hold which amplifier’s read noise.

Parameters:
  • l1_obj (KPF1) – KPF1 data object (post-ImageAssembly).

  • output_dir (str or None) – Directory to save PNG files. None returns the Figure only.

  • full_res (bool) – Save full 1:1 pixel-resolution PNGs instead of the default downsampled figure PNGs. Full-resolution files can be tens of MB per chip.

bias_subtracted(chip)

Image with master bias subtracted.

Matches v2.12 plot_2D_image(subtract_master_bias=True).

column_cut(chip)

Median column profiles at 10th/50th/90th percentiles. Matches v2.12 plot_2D_column_cut.

dark_subtracted(chip)

Image with master dark subtracted, displayed in e-/hr. Matches v2.12 plot_2D_image(subtract_master_dark=True).

histogram(chip)

Flux distribution histogram. Matches v2.12 plot_2D_image_histogram.

image(chip, *, full_res=None)

Plot the assembled FFI for one CCD.

Replicates v2.12 plot_2D_image for the basic science-frame case.

Parameters:
  • chip (str) – ‘green’ or ‘red’.

  • full_res (bool or None) – Save a native-size, one-output-pixel-per-CCD-pixel PNG when true. None uses the constructor’s full_res setting.

Returns:

The assembled-FFI figure.

Return type:

matplotlib.Figure

order_trace_overlay(chip)

2x2 grid with order trace overlaid. Matches v2.12 plot_2D_order_trace2x2. Requires calibration DB lookup for order trace file (not yet in v3).

run(which, *, full_res=None)

Generate the requested plot(s) for every chip that has data.

Saves each to output_dir and, in that save-to-disk mode, closes the matplotlib figure so callers don’t accumulate them. When output_dir is None the figures are returned open, so they display when the caller renders them (e.g. interactively in a notebook).

Parameters:
  • which (str) – ‘all’ to run every implemented plot, or the name of a single plot method (one of self._PLOT_METHODS).

  • full_res (bool or None) – Save native-size PNGs when true. None uses the constructor’s full_res setting.

Returns:

Maps {method_name}_{chip} to its matplotlib.Figure (closed only when saved to output_dir); useful for tests and introspection.

Return type:

dict

Raises:

ValueError – If which is neither ‘all’ nor a known plot method name.

zoom_3x3(chip)

3x3 grid of zoomed detector regions. Matches v2.12 plot_2D_image_zoom_3x3.