add_attributes.add_attributes

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 file

  • filename (str) – Name of the HDF5 output file

  • process_irga_data_day (bool) – Flag indicating whether IRGA data was processed

  • n_irga (int) – Number of concentration variables from IRGA

  • process_tracer_data_day (bool, optional) – Flag indicating whether tracer data was processed

  • tracerdata (bool or dict, optional) – If dict, contains tracer-specific metadata

Returns:

Function modifies the HDF5 file in place

Return type:

None

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