add_attributes
Module for adding standardized metadata to GEddySoft HDF5 output files.
This module handles the addition of descriptive attributes to HDF5 datasets produced by GEddySoft eddy covariance processing. It ensures that all output files have consistent and well-documented metadata including:
Variable descriptions
Physical units
Quality control flags
Processing parameters
Instrument-specific metadata
The metadata follows community standards and best practices for eddy covariance data, making the outputs compatible with standard analysis tools and workflows.
Functions
Add standardized metadata attributes to HDF5 output files. |
- add_attributes.add_attributes(filepath, filename, process_irga_data_day, n_irga, process_tracer_data_day=False, tracerdata=False)[source]
Add standardized metadata attributes to HDF5 output files.
This function adds descriptive attributes to each dataset in the HDF5 output file, including variable descriptions and physical units. It handles metadata for different data types:
Basic file information (creation time, frequencies)
Meteorological variables (wind, temperature, pressure)
IRGA measurements (if present)
Tracer measurements (if present)
Quality control metrics
Processing parameters
- Parameters:
filepath (
str
) – Directory path containing the HDF5 output filefilename (
str
) – Name of the HDF5 output fileprocess_irga_data_day (
bool
) – Flag indicating whether IRGA data was processedn_irga (
int
) – Number of concentration variables from IRGAprocess_tracer_data_day (
bool
, optional) – Flag indicating whether tracer data was processedtracerdata (
bool
ordict
, optional) – If dict, contains tracer-specific metadata
- Returns:
Function modifies the HDF5 file in place
- Return type:
Notes
The function adds two key attributes to each dataset: - ‘description’: Human-readable description of the variable - ‘units’: Physical units in standard notation
For quality control flags, additional metadata about test thresholds and criteria is included.
The metadata structure follows the hierarchy: - Root level: Basic file information - /MET: Meteorological measurements - /IRGA: Gas analyzer data (if present) - /TRACER: Tracer measurements (if present)
See also
h5py.File
HDF5 file handling in Python