map_sonic2tracer
Module for synchronizing sonic anemometer and tracer gas analyzer files.
This module provides functionality to match sonic anemometer and tracer gas analyzer files based on their timestamps, ensuring that flux calculations only proceed when both measurements are available. It handles:
Parsing of standardized filename formats
Half-hourly period matching
Filtering of unpaired measurements
Functions
Filter sonic files to keep only those with matching tracer files. |
|
Parse datetime from sonic anemometer filename. |
|
Parse datetime from tracer gas analyzer filename. |
- map_sonic2tracer.parse_datetime_sonic(filename)[source]
Parse datetime from sonic anemometer filename.
- Parameters:
filename (
str
) – Filename in format ‘GHS50_YYYY_MM_DD__HH_MM_SS.hdf5’- Returns:
Parsed datetime object
- Return type:
datetime
- map_sonic2tracer.parse_datetime_tracer(filename)[source]
Parse datetime from tracer gas analyzer filename.
- Parameters:
filename (
str
) – Filename in format ‘K2_BE-Vie_YYYY_TOF4000_YYYY_MM_DD__HH_MM_SS.h5’- Returns:
Parsed datetime object
- Return type:
datetime
- map_sonic2tracer.map_sonic2tracer(all_sonic_files_list, all_tracer_files_list)[source]
Filter sonic files to keep only those with matching tracer files.
This function examines sonic anemometer files and keeps only those that have corresponding tracer gas analyzer files within the same half-hour period. This ensures data synchronization for flux calculations.
- Parameters:
- Returns:
Filtered sonic files dictionary containing only entries with matching tracer files. Maintains same structure as input dictionary.
- Return type:
Notes
The matching process: 1. For sonic files at MM=00, looks for tracer files between MM=00-29 2. For sonic files at MM=30, looks for tracer files between MM=30-59 3. Files must match exactly in year, month, day, and hour