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_encodingattribute of the unified labelling scheme, then thedata_typeattribute 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 underdata_encoding.Files with raw ADC data (
"full-raw") are converted to volt with the conversion parameters stored in the file attributes, unlessconvert_ADC_to_Vis False (then the raw counts are returned). Legacy files (float64 volts, no attributes) and downsampled files ("downsampled", non-uniform time axis stored ast_sdataset) 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_Vis False for a raw file (then they are ADC counts).U_diodeis None for single-channel files without a diode dataset. The attributes always contain the resolved storage sub-format asdata_encoding.