spvctrl.spvctrl_interactive.finalize_measurement#
- finalize_measurement(measurement_params: TspvSettings | None, data_dir: str | Path)[source]#
Finalize, archive and copy a finished measurement.
Builds a TspvData from the averaged transient (
data.h5, including the pre-trigger baseline) with the hierarchy (series, variant, part) derived from the measurement settings, storing the average as part+and — whenMeasurementParameters.store_individual_pulsesis set — the individual pulses as partspulse0001, …, then finalizes it (.tspv, csv and plots written into the data directory), archives the data directory (only if it contains at leastarchive_file_count_thresholdper-pulse partial files) and copies the final files hierarchically to the final data directories (settings.data_dir). Errors are logged and do not raise, so that a failed copy does not lose the measurement.- Parameters:
measurement_params – Measurement settings used for the measurement.
data_dir – Measurement directory in the cache.