How uba/tathu works
1. What this repository is
TATHU is a Python library for detecting, tracking, characterizing, and forecasting convective systems. It is organized as a domain-specific processing pipeline rather than a single app: ingest remote sensing data, convert it into a common spatial form, identify storm objects, associate them over time, and persist or visualize the results.
2. Core architectural idea
The codebase centers on a small conceptual model with four interchangeable roles: Detector, Descriptor, Tracker, and Forecaster. These operate on a shared storm entity, the ConvectiveSystem, which carries a UUID, geometry, timestamp/event metadata, and derived fields. This abstraction boundary is the main reason the library can support radar, multiple satellite products, and future data sources.
3. Data ingestion subsystem
Source-specific adapters live under tathu/satellite, tathu/radar, and tathu/downloader. They handle external observation formats such as GOES, GOES-13/GOES-R, GLM, MSG, MERGIR, and radar CAPPI files. The role of this layer is to normalize raw sensor data into analysis-ready rasters/grids, not to perform tracking logic.
4. Spatial normalization and geometry
The tathu/geometry package provides the geospatial primitives used across the project: extents, coordinate transforms, envelopes, and utility functions. This layer is important because detection and tracking are done in a consistent spatial reference, often by remapping sensor-native data to a regular lat/lon grid before analysis.
5. Detection and characterization
tathu/tracking/detectors.py identifies candidate convective objects from an image or grid, typically using thresholding and connected-region logic. tathu/tracking/descriptors.py enriches each detected system with quantitative attributes such as area, min/mean/std, and count. This is the first point where raw pixels become structured storm objects.
6. Temporal association and forecasting
tathu/tracking/trackers.py links systems across consecutive times using overlap-based strategies and related heuristics, turning independent detections into a lifecycle. tathu/tracking/forecasters.py then extrapolates future behavior from the tracked history, with conservative motion-based prediction as one implemented strategy. This is the main time-series boundary in the architecture.
7. Domain-specific tracking extensions
The package also includes specialized tracking logic in tathu/tracking/system.py and tathu/tracking/squall_line.py, plus helper utilities and descriptors. This suggests the library supports multiple storm-object interpretations, not only generic blobs, and can represent more specific phenomena such as squall lines.
8. Persistence and data exchange
The tathu/io layer is the repository’s integration boundary for storage. It supports CSV-like output, geospatial databases such as SpatiaLite and PostGIS, plus loaders/query helpers for reading back storm families by name, duration, day, or SQL query. This is where tracked objects become an analyzable database rather than just in-memory results.
9. Visualization
tathu/visualizer.py and related tracking visualizers provide map-based and lifecycle views. The visualizers consume the normalized grid plus detected/tracked systems, so they sit downstream of detection and are not involved in core computation. This makes visualization a read-only presentation layer.
10. Supporting infrastructure
The repository includes extensive examples/, notebooks/, and docs/sphinx/ content, which function as executable documentation and usage demonstrations rather than production subsystems. tools/tracking.py and the example config show that the library can be driven from scripts/CLI-style workflows, while tests/ validates the package surface. The bundled radar sample data under data/radar is test/demo input for these workflows.
11. Typical end-to-end data flow
The canonical pipeline is: load sensor data from satellite/radar → remap to a common grid → detect convective systems → compute attributes → track across time steps → forecast future positions/behavior → write to CSV or spatial database → load/query for history analysis and visualization. That flow is the best basis for an architecture diagram.
12. Technology and deployment shape
The project is a pure Python geospatial/scientific package with packaging support via setup.py, conda.recipe, and an env.yml. The architecture depends materially on geospatial data handling and database-backed storage, but it is not built around a web server or distributed runtime. Its main deployment modes are library use, notebooks, scripts, and documentation examples.
Main entry points: system.py Convective system · trackers.py Trackers · geometry Geometry · __init__.py tathu
Components 18
Support & examples
Packaging, docs, examples, and demo assets
- Examples & docs · Executable examples, notebooks, and Sphinx documentation
examples
Ingestion
Source-specific adapters and downloaders
- Satellite adapters · GOES, GLM, MSG, and related satellite readers
tathu/satellite - Radar adapter · Radar CAPPI reader and normalization entry point
tathu/radar/radar.py - Downloaders · Fetches source data from external providers
tathu/downloader
Spatial model
Common geometry and normalization layer
- Geometry · Extents, transforms, envelopes, and spatial utilities
tathu/geometry
Tracking core
Detection, descriptors, association, forecasting, and storm entities
- Detectors · Thresholding and connected-region detection of convective objects
tathu/tracking/detectors.py - Descriptors · Area and intensity statistics for detected systems
tathu/tracking/descriptors.py - Convective system · Shared storm object carrying geometry, timestamp, and derived fields
tathu/tracking/system.py - Trackers · Links detections across time into storm lifecycles
tathu/tracking/trackers.py - Forecasters · Extrapolates future behavior from tracked history
tathu/tracking/forecasters.py - Squall line · Domain-specific storm interpretation and tracking extension
tathu/tracking/squall_line.py - Tracking utils · Shared helper logic for tracking workflows
tathu/tracking/utils.py
Persistence
Outputs and database-backed exchange
- CSV I/O · CSV-like persistence for storm tracks and summaries
tathu/io/icsv.py - SpatiaLite · SQLite/SpatiaLite storage for tracked systems
tathu/io/spatialite.py - PostGIS · PostgreSQL/PostGIS persistence and queries
tathu/io/pgis.py - Forecast I/O · Read/write helpers for forecast products and metadata
tathu/io/forecast.py
Visualization
Map and lifecycle presentation
- Visualizer · Map-based and lifecycle visual views
tathu/visualizer.py
Other components
- tathu · Top-level library package exposing the public surface
tathu/__init__.py
Connections 24
- tathu → Satellite adapters: uses · Library entry point exposes sensor adapters
- tathu → Radar adapter: uses · Library entry point exposes radar support
- tathu → Geometry: uses · Core package depends on spatial primitives
- tathu → Detectors: uses · Public API includes tracking pipeline components
- Satellite adapters → Geometry: normalize · Remap sensor-native data into a common spatial form
- Radar adapter → Geometry: normalize · Convert radar products to analysis-ready grids
- Downloaders → Satellite adapters: feeds · Fetches upstream products for adapter processing
- Geometry → Detectors: grid · Detection operates on normalized spatial grids
- Detectors → Convective system: creates · Candidate objects become storm entities
- Detectors → Descriptors: passes · Detected objects are enriched with quantitative features
- Descriptors → Convective system: annotates · Derived metrics are stored on the storm entity
- Convective system → Trackers: links · Tracked objects are associated across time steps
- Trackers → Forecasters: history · Track history provides the basis for prediction
- Trackers → Squall line: specializes · Specialized storm interpretations extend generic tracking
- Trackers → Tracking utils: shares · Common logic supports association strategies
- Convective system → CSV I/O: exports · Track results can be serialized to tabular form
- Convective system → SpatiaLite: persists · Storm families can be stored in spatial SQLite
- Convective system → PostGIS: persists · Storm families can be stored in PostGIS
- Forecasters → Forecast I/O: writes · Predictions are exchanged through forecast I/O
- SpatiaLite → Visualizer: loads · Stored histories can be queried for visualization
- PostGIS → Visualizer: loads · Database-backed tracks can be rendered and inspected
- Geometry → Visualizer: renders · Visualization consumes normalized geometry and grids
- Examples & docs → Satellite adapters: demonstrates · Examples and notebooks show sensor-specific workflows
- Examples & docs → Trackers: demonstrates · Documentation covers detection, tracking, and forecasting flows