prsctrl.data.finalize#

Utilities for saving data, plots, csvs and other files after a measurement.

After a measurement, one will typically one PrsData instance per measurement mode, with their data directory being flat in the cache directory.

  1. Use finalize_data to finalize te cache data directory: recalculate data, plot data, save a csv, save final metadata as yaml, add report.

  2. Use archive_data to save the cache data directories to a secure location as a zip file. This means you will always have the raw, untouched data as a backup.

  3. Use copy_files_and_save_hdf5 to save the data in a hierachical structure in your main data directory/directories.

    This saves the raw data in the HDF5 file in the series directory, and copies all pdf,csv,yaml… files created during finalize_data to the correct subdirectory.

  4. Use add_absorption to add calculated absorption data in the hierarchical data structure(s).

  5. Use merge_parts to add a merged version of all measurement parts in the hierarchical data structure(s).

TODO: adapt and implement

Functions

archive_data

Save a zip of the data directory in the archive directory (if it contains enough partial files).

copy_files_and_save_hdf5

Save data in hierarchical HDF5 and copy csvs and pdfs into the hierarchical directory.

finalize_data

merge_parts

For all measurements in the series, merge all parts.

save_absorption_data

Calculate absorption data and save it in a subdirectory of the hierachical data structure(s) in data_dir_final(s).