prsctrl.data.finalize.save_absorption_data#
- save_absorption_data(ref_data: PrsData, tra_data: PrsData, target_dirs: Path | str | list[Path | str], norm_data_dir: Path | str | None, overwrite: bool = False, **plot_spectrum_kw) tuple[PrsData | None, list[Exception]][source]#
Calculate absorption data and save it in a subdirectory of the hierachical data structure(s) in data_dir_final(s).
The absorption data is calculated and saved to the data directory in the target directory. The group_path is inferred from the reflectance data, and the mode is exchanged for “abs”. Additional files (RTA plot, report and csv) are created in the series directory in the first target directory and then copied to all other target directories.
Errors during saving are caught and returned instead of being raised immediately. This means if saving to one location fails, the data may still be saved in other locations.
Example#
If the hierarchy of the reflectance data is
Series=01/f=30Hz/ref/Visthen the absorbance data is created inSeries=01/f=30Hz/abs/Vis.- param data_dir_path_no_suffix:
Path to the reference and transmission data, without “-ref”/”-tra”)
- param copy_data_dirs:
Directory(ies) to copy the data to
- param dont_save_partial_files:
- return:
Absorption data and any errors that occured.