hypso.io.provenance#
Processing provenance carried in every product.
Each processing step adds a metadata/processing/<step> node (one per step, kept when the product is read and written again, so a file holds its whole lineage) and one line to the global history attribute:
- 2026-10-26T10:02:11Z: l1c from HYPSO2_HSI.20250612T095802.aeronetvenice.L1B.nc,
hypso-package 26.10.0 (git 25f4c3bf)
Node attributes: date_utc, software / software_version / software_git_commit / software_git_dirty, input_file, the step’s parameters (scalars as attributes, anything else as JSON), and optionally:
calibration: package / version / git commit, and <kind>_file + <kind>_sha256 for every coefficient file loaded (versions alone don’t identify coefficients - see docs/versioning.rst);
ac: tool, version, git commit, install path, settings_effective (full settings actually used, JSON) and settings_user (only what the user set). Credential-like keys are removed and listed in settings_redacted_keys.
Functions#
|
Provenance attributes for an atmospheric correction tool run. |
|
The AC provenance attributes that go into a file's global attributes ( |
|
Record a processing step on a product tree, in place. |
|
A NetCDF-storable attribute value: bools as "true"/"false", None as |
|
Provenance attributes for the calibration files used. |
|
Remove credential-like keys (user names, passwords, tokens, secrets, API keys) from settings. |
hypso-package's name, version and git commit, for a provenance step. |
|
|
The current UTC time, ISO 8601 to the second with a |
Module Contents#
- hypso.io.provenance.ac_attrs(tool, version=None, git_commit=None, install_path=None, settings_effective=None, settings_user=None, git_dirty=None, components=None)[source]#
Provenance attributes for an atmospheric correction tool run.
- Parameters:
tool (str) – The tool and how it was installed; the commit is “” when the tool is not a git checkout.
version (str) – The tool and how it was installed; the commit is “” when the tool is not a git checkout.
git_commit (str) – The tool and how it was installed; the commit is “” when the tool is not a git checkout.
install_path – The tool and how it was installed; the commit is “” when the tool is not a git checkout.
git_dirty (bool or None) – Uncommitted changes in the tool’s checkout (
ac_git_dirty“true”/”false”; “unknown” when a commit is known but its state is not; “” without a commit).components (dict, optional) – Other parts of the tool with their own checkout,
{name: (commit, dirty)}, recorded asac_<name>_git_commit/ac_<name>_git_dirty(e.g. POLYMER’seoread, which holds the HYPSO reader).settings_effective (dict) – Stored as JSON with credential-like keys removed (
redact()).settings_user (dict) – Stored as JSON with credential-like keys removed (
redact()).
- Return type:
- hypso.io.provenance.ac_global_attrs(ac)[source]#
The AC provenance attributes that go into a file’s global attributes (
AC_GLOBAL_ATTRSand the extra components’ version, commit and dirty flags); not settings or paths.
- hypso.io.provenance.add_step(tree, step, *, input_file=None, parameters=None, calibration=None, ac=None)[source]#
Record a processing step on a product tree, in place.
Adds
metadata/processing/<step>and a line to thehistoryattribute.- Parameters:
tree (xarray.DataTree)
step (str) – Step name, e.g.
"l1b","regrid".input_file (str or path, optional) – What the step read (only its name is kept).
parameters (dict, optional) – The step’s parameters.
calibration (dict, optional) – From
calibration_attrs()andac_attrs().ac (dict, optional) – From
calibration_attrs()andac_attrs().
- Return type:
None
- hypso.io.provenance.attr_value(value)[source]#
A NetCDF-storable attribute value: bools as “true”/”false”, None as “”, containers as JSON, numbers and strings unchanged.
- hypso.io.provenance.calibration_attrs(package, files)[source]#
Provenance attributes for the calibration files used.
- hypso.io.provenance.redact(settings)[source]#
Remove credential-like keys (user names, passwords, tokens, secrets, API keys) from settings.
- Returns:
settings (dict) – Without those keys.
removed (list of str) – The removed keys, sorted.
- Parameters:
settings (dict)