pysp2.io.read_sp2xr_hk_file#

pysp2.io.read_sp2xr_hk_file(file_name)[source]#

This procedure will read in an SP2-XR housekeeping file (.csv or .zip) and store the timeseries data into an xarray Dataset.

The SP2-XR housekeeping file uses comma-separated values (rather than tab-separated like the original SP2). The ‘Time Stamp (UTC sec)’ column is used to build the time coordinate, sharing the same 1904-01-01 epoch as the original SP2 ‘Timestamp’ column.

The SP2-XR firmware-computed PSD bin columns (named like ‘Scatter Bin N’ and ‘Incand Bin N’) are excluded from the output to keep the variable set similar to read_hk_file(). Use read_sp2xr_hk_psd() to access them as a 2D dataset.

The retained ‘Scattering Mass Conc’ and ‘Incand Mass Conc’ columns are firmware-computed using the on-board calibration curves. To preserve provenance, the calibration CSV files alongside the HK file (matching ‘_Scatt_.csv’ and ‘_Incan_.csv’) are auto-located and attached as dataset attributes; a warning is emitted for any missing file.

Parameters:

file_name (str) – The file name to read in (.csv or .zip).

Returns:

hk_ds (xarray.Dataset) – The housekeeping information as an xarray Dataset indexed by time, with the firmware-computed PSD bin columns removed.