pyfli.io.data_saving#
Save fitted maps, metadata, figures, and session artifacts to disk.
This module belongs to pyfli.io and is part of PyFLI detector importers, file
readers, saving helpers, and processed-data loaders. Public API includes classes
DataSaver; functions filter_vars().
Functions
|
Run the filter vars routine. |
Classes
|
Persist PyFLI fitting outputs and analysis artifacts. |
- filter_vars(local_vars, keys)[source]#
Run the filter vars routine.
- Parameters:
local_vars (
np.ndarray) – Local variable dictionary filtered before saving.keys (
np.ndarray) – Dataset keys to include in the saved output.
- Returns:
Object produced by filter vars.
- Return type:
Any
- class DataSaver(path, folder_name='_pyfli_Analysis', new_session=False)[source]#
Bases:
objectPersist PyFLI fitting outputs and analysis artifacts. The class creates a session directory and writes arrays, metadata, figures, and tabular summaries in a consistent layout.
- Parameters:
- classmethod load(save_dir)[source]#
Convenience constructor for reconnecting to an existing session folder for data loading. Equivalent to:
DataSaver(path=save_dir, folder_name=None, new_session=False)
- classmethod resolve_path(path, folder_name)[source]#
Public helper: returns the save_dir that DataSaver(path, folder_name) would resolve to, without creating it. Use this to derive the load path for an auto-saved session before deciding whether to load from or write into it.
- log(message)[source]#
Run the log routine.
- Parameters:
message (
Any) – Message text displayed to the user.- Returns:
No object is returned; the function perform log.
- Return type:
- log_to_file(message)[source]#
Append to the log file only, without echoing through logging/console.
Use for bulk/verbose content (e.g. a printed comparison table) that belongs in the session log but would be noisy to also emit via the logger on every line. For normal status messages, use
log().- Parameters:
message (
Any) – Message text appended to the log file.- Returns:
No object is returned; the message is written to
self.log_file.- Return type:
- save_plot(name, fig=None, dpi=300, close=True)[source]#
Save plot.
- Parameters:
- Returns:
No object is returned; the function save plot.
- Return type:
- save_params(**kwargs)[source]#
Save params.
- Parameters:
**kwargs (
Any) – Additional keyword options forwarded to the underlying implementation.- Returns:
No object is returned; the function save params.
- Return type: