pysp2.io.read_sp2xr_hk_psd#

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

Read the SP2-XR firmware-computed PSD histograms from a HK file.

The on-board firmware accumulates per-second particle counts into size/mass bins (‘Scatter Bin N’ for scattering size, ‘Incand Bin N’ for incandescence mass) using its own calibration. This procedure extracts those columns into a 2D dataset shaped (time, num_bins), matching the convention used by pysp2.util.process_psds() for PySP2-computed distributions (ScatNumEnsemble, IncanNumEnsemble).

Calibration curves for scattering diameter and incandescence mass are auto-located alongside the HK file (files matching ‘_Scatt_.csv’ and ‘_Incan_.csv’ respectively) and attached as dataset attributes when present. A warning is issued for any missing calibration file.

Parameters:

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

Returns:

psd_ds (xarray.Dataset) – Dataset with dimensions (time, num_bins) and data variables ScatNumEnsemble and IncanNumEnsemble (raw counts per bin per time). Sample volume must be applied to convert to concentration.