spvctrl.data.util.load_pulse_hdf5#

load_pulse_hdf5(file_path: str | Path, convert_ADC_to_V: bool = True) → tuple[ndarray, ndarray, ndarray | None, dict][source]#

Load a pulse file saved with save_pulse_hdf5(), including the time axis.

The storage sub-format is resolved with a fallback chain: the data_encoding attribute of the unified labelling scheme, then the data_type attribute of the intermediate scheme (which carried the sub-format value), then the legacy default "full-volts" (files without any attribute). The resolved sub-format is stored in the returned attributes under data_encoding.

Files with raw ADC data ("full-raw") are converted to volt with the conversion parameters stored in the file attributes, unless convert_ADC_to_V is False (then the raw counts are returned). Legacy files (float64 volts, no attributes) and downsampled files ("downsampled", non-uniform time axis stored as t_s dataset) are handled transparently.

Parameters:
  • file_path – Path of the hdf5 file

  • convert_ADC_to_V – Whether to convert raw ADC counts to volt on load

Returns:

(t_s, U_spv, U_diode, attributes), where U_spv/U_diode are voltages unless convert_ADC_to_V is False for a raw file (then they are ADC counts). U_diode is None for single-channel files without a diode dataset. The attributes always contain the resolved storage sub-format as data_encoding.