This repository contains a Python toolset designed to parse Telescope Array (TAx4) detector run logs, extract weather information from structured XML files, and generate .weather.log files per data segment. Optional plotting features help visualize time coverage and weather code placement.
- Parses TAx4 run logs and infers missing stop times.
- Matches local and remote weather codes to time segments.
- Applies robust time-weighted averaging (including haze-specific rules).
- Outputs
.weather.logfiles with surrounding weather context. - Optional visualization of time segments and weather entries.
- Python 3.8+
numpy,matplotlib
python main.py -d brtax4 path/to/logfile.xmlAdd --plot to visualize the night's data:
python main.py -d brtax4 path/to/logfile.xml --plotpython taweat_run.py(This runs main.py over all log files for the detector specified in taweat_run.py.)
main.py— Entry point that orchestrates parsing, weather assignment, and output writing.taweat_run.py— Batch execution over a log file directory.parser.py— Extracts run parts and weather code timestamps from the XML structure.weather.py— Assigns weather codes using custom logic including pre/post-run handling and interpolation.utils.py— Time conversion, XML loading, and helper functions.clouds.py— Weather code interpretation and comparison logic.data_part.py— Container class for time segments and their associated weather codes.writer.py— Outputs.weather.logfiles per segment.plotting.py— Visualizes weather entries and run segments on a timeline.
- Pre/post-run codes are handled specially and optionally prepended/appended.
- Remote timestamps are inserted to fill gaps > 1 hour when local-only would be insufficient (specific to
brtax4). - Haze value rules: When averaging, haze is treated non-linearly (1 = hazy, 2 = uncertain, 0 = clear).
Each .weather.log file contains a line:
<start_time> <prev_code> <current_code> <next_code>
This format supports time-evolution analysis across the night.
Zane Gerber
August 2024
MIT License or your collaboration’s standard license.