KPF

Level 2

class rvdata.instruments.kpf.level2.KPFRV2

Bases: RV2

Data model and reader for RVData Level 2 (RV) data constructed from KPF Level 0 and KPF Level 1 pipeline products.

This class extends the RV2 base class to handle Keck Planet Finder (KPF) data. It reads the relevant science and calibration extensions from both a KPF Level 0 and a KPF Level 1 FITS file, organizes them into a standardized format, and provides convenient access to flux, wavelength, variance, blaze, and metadata for each fiber and chip.

:param Inherits all parameters from RV2.:

extensions

Dictionary of all created extensions (e.g., ‘TRACE2_FLUX’, ‘TRACE2_WAVE’, etc.), mapping extension names to their data arrays.

Type:

dict

headers

Dictionary of headers for each extension, mapping extension names to their FITS headers.

Type:

dict

data

Dictionary of data arrays for each extension.

Type:

dict

Notes

To construct an RVData Level 2 object, both a KPF Level 0 and a KPF Level 1 FITS file are required. The classmethod from_fits should be used to instantiate the object from these files. The _read method is not intended to be called directly by users.

Example

>>> from rvdata.instruments.kpf.level2 import KPFRV2
>>> obj = KPFRV2.from_fits("kpf_L1.fits", l0file="kpf_L0.fits")
>>> obj.to_fits("kpf_L2_standard.fits")