spvctrl.data.finalize.save_measurement_to_tspv#
- save_measurement_to_tspv(data_dir: str | Path, tspv_dir: str | Path, series: str, variant: str | None, metadata: dict, settings: TspvSettings, versions: set[str] | None = None) TspvData[source]#
Assemble the .tspv data file from a finished measurement directory.
The averaged transient (
data.h5) is stored as the part+and marked as the default part, so that loading without explicit hierarchy arguments resolves the average. The individual pulses (thePART_*.h5files of the measurement directory) are stored as additional partspulse0001,pulse0002, … whenMeasurementParameters.store_individual_pulsesis set. Each version key inversionsis stored as its own version hierarchy branch of all parts (seeTspvData._REPRESENTATIONS): ‘full’ pulse data (the raw-ADC int16 layout, or float64 voltages when the oscilloscope does not support raw ADC access) is stored in therawbranch (full record) and thelog-subbranch (log-downsampled), ‘downsampled’ pulse data only in thelog-subbranch.- Parameters:
data_dir – Measurement directory in the cache, containing
data.h5and thePART_pulse files.tspv_dir – Directory the .tspv file is stored in.
series – Series name of the hierarchy.
variant – Variant name of the hierarchy (e.g.
wl=355nm), or None.metadata – Metadata for the TspvData object of the averaged part.
settings – Measurement settings used for the measurement.
versions – Set of version keys to store (see
TspvData._REPRESENTATIONS), or None to derive from the measurement data: log-sub, plus raw when the measurement stored full transients.
- Returns:
The TspvData object of the averaged (‘+’) part of the default (log-subsampled) version.