Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d3a2245
resolved conflict
mariusaurus Dec 1, 2025
0189d52
update changelog
dallasfoster Sep 19, 2025
f11b18b
move seed initialization and fix dxwrapper tests
dallasfoster Sep 19, 2025
d063760
tempest extremes diagnostic model
mariusaurus Sep 15, 2025
a4d2544
error message
mariusaurus Sep 25, 2025
c1cdca0
testing if TE is available and works
mariusaurus Sep 25, 2025
016f16b
started working on support for batch sizes >1, currently works for bs 1
mariusaurus Sep 25, 2025
68e33b5
halfway to larger batch support
mariusaurus Sep 25, 2025
7bd60e1
enabling TE for batch sizes of >1. async version seems to work as wel…
mariusaurus Sep 26, 2025
3b0c00e
option to pass file names to TE connector
mariusaurus Sep 29, 2025
1e9bbe8
array equal test
mariusaurus Sep 29, 2025
d6be6dd
first stable try
mariusaurus Oct 7, 2025
1e9b275
support for per-member parallel execution and lets user controll max …
mariusaurus Oct 7, 2025
b5f5c18
precommit hooks
mariusaurus Oct 7, 2025
af8bc71
vibe-coded some tests, need to be hand-tested and selected
mariusaurus Oct 7, 2025
a9fd2bc
vibe-coded some tests, need to be hand-tested and selected
mariusaurus Oct 7, 2025
526e6bf
passing all pre-commit tests, still need to sub-select tests as there…
mariusaurus Oct 7, 2025
c3258d9
subselected tests
mariusaurus Oct 7, 2025
3fd145d
install doc
mariusaurus Oct 8, 2025
c26f453
throwing an error in case cleanup is not called before object goes ou…
mariusaurus Oct 8, 2025
d2a8e4a
custom depenmdency failure message for TE
mariusaurus Oct 8, 2025
0ab6d67
moved tensor tiling and concatenation to utils
mariusaurus Oct 8, 2025
8ca3fae
enable setting fcn3 random seed
dallasfoster Sep 19, 2025
e93932e
add proper noise handling for fcn3
dallasfoster Sep 19, 2025
bc9e3ac
fix linting and test issues
dallasfoster Sep 19, 2025
2685f90
update lockfile
dallasfoster Sep 19, 2025
e3a4e3d
move seed initialization and fix dxwrapper tests
dallasfoster Sep 19, 2025
1dec990
tc tracking pipeline
mariusaurus Oct 13, 2025
02945f1
update
mariusaurus Oct 13, 2025
f89efe3
updated uv.lock
mariusaurus Oct 13, 2025
92896eb
seems to work now
mariusaurus Oct 13, 2025
9e0e106
wind gust from HRRR analysis
mariusaurus Oct 14, 2025
5550ad9
minor updates
mariusaurus Oct 14, 2025
869b8fe
stability test
mariusaurus Oct 24, 2025
343d035
version check for torch-harmonics import
mariusaurus Oct 24, 2025
037a5a7
addressed greptile comments
mariusaurus Oct 30, 2025
608315b
time import
mariusaurus Oct 30, 2025
3f55702
comma
mariusaurus Oct 30, 2025
7fefe5b
merged main
mariusaurus Jan 9, 2026
dc0cd79
updated env
mariusaurus Jan 9, 2026
70361a7
moved tempest_extremes
mariusaurus Jan 9, 2026
e172e50
wip
mariusaurus Jan 9, 2026
edb1978
exploring aifs ensemble capability
mariusaurus Jan 13, 2026
e3b2ed0
Merge branch 'main' into mkoch/tc_tracking
mariusaurus Jan 13, 2026
8c3c848
thread issue with writing to netcdf in threads
mariusaurus Jan 13, 2026
d41351e
automated testing of writing TE files and their reproducibility. bug …
mariusaurus Jan 14, 2026
780e458
README for tc_hunt test
mariusaurus Jan 14, 2026
4360ea4
second test for extracting historic data
mariusaurus Jan 14, 2026
8f766f5
added aux data for tests
mariusaurus Jan 14, 2026
5bd90c6
merged main
mariusaurus Jan 15, 2026
f3286fb
test for reference track extraction
mariusaurus Jan 15, 2026
3638bcc
wip
mariusaurus Jan 16, 2026
5b7ae87
track plotting notebook
mariusaurus Jan 16, 2026
3002fd0
field and track notebook
mariusaurus Jan 16, 2026
0b968b3
plotting tracks and fields notebook
mariusaurus Jan 19, 2026
67f7fc6
case study notebook
mariusaurus Jan 20, 2026
2df89f7
Merge branch 'main' into mkoch/tc_tracking
mariusaurus Jan 20, 2026
0f046a1
REAMEs and markdowns in notebooks
mariusaurus Jan 20, 2026
fbdbc9f
drafted readme
mariusaurus Jan 21, 2026
b495b31
first iteration over readme
mariusaurus Jan 22, 2026
ad4717c
final touches README
mariusaurus Jan 22, 2026
34fda29
...gif
mariusaurus Jan 22, 2026
78dc346
wip
mariusaurus Jan 23, 2026
b76a7d3
Merge branch 'main' into mkoch/tc_tracking
mariusaurus Jan 23, 2026
fb7f207
verified plotting for west-pacific
mariusaurus Jan 23, 2026
d4926cf
final touches
mariusaurus Jan 23, 2026
f0fcff0
removed some configs
mariusaurus Jan 23, 2026
2c8eaf3
pyproject project name
mariusaurus Jan 23, 2026
b4af03e
README comment about conainer build time
mariusaurus Jan 23, 2026
1bf9850
removed TE from models/dx/__init__
mariusaurus Jan 23, 2026
99ae8ba
moving a bracket around
mariusaurus Jan 23, 2026
6048522
Merge branch 'main' into mkoch/tc_tracking
mariusaurus Feb 10, 2026
5da7854
updated base container
mariusaurus Feb 18, 2026
ff5dcba
Merge branch 'main' into mkoch/tc_tracking
mariusaurus Feb 19, 2026
acd0354
Merge branch 'mkoch/tc_tracking' of github.com:mariusaurus/earth2stud…
mariusaurus Feb 19, 2026
f067969
merged main, might be broken
mariusaurus Mar 10, 2026
6c85a95
Merge branch 'mkoch/tc_tracking' of github.com:mariusaurus/earth2stud…
mariusaurus Mar 10, 2026
2f4b495
fixed some bugs to be in line with new main
mariusaurus Mar 11, 2026
d240ae2
split plan
mariusaurus Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/userguide/about/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ uv add earth2studio --extra corrdiff
::::
:::::
:::::{tab-item} Cyclone Trackers
Notes: Additional dependencies for all cyclone tracking models. Only Python 3.12 and
below support.
Notes: Additional dependencies for cyclone tracking models `TCTrackerVitart` and `TCTrackerWuDuan`.
Only Python 3.12 and below support.

::::{tab-set}
:::{tab-item} uv
Expand All @@ -538,6 +538,16 @@ uv pip install earth2studio --extra cyclone
pip install earth2studio[cyclone]
```

`TempestExtremes` is not provided as a Python library and must be installed
separately by the user. Installation instructions can be found on the
[TempestExtremes GitHub page](https://github.com/ClimateGlobalChange/tempestextremes?tab=readme-ov-file#installation-via-cmake-recommended).

By default, `TempestExtremes` binaries are installed to the bin folder of the
`TempestExtremes` repository. Users can specify paths to executables by passing
the detect and stitch commands to the initialisation of the `TempestExtremes`
class in earth2studio. Examples for both commands are provided in the docstring
of this class.

:::
::::
:::::
Expand Down
10 changes: 10 additions & 0 deletions earth2studio/models/px/fcn3.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import numpy as np
import torch
from loguru import logger
from packaging.version import Version

from earth2studio.models.auto import AutoModelMixin, Package
from earth2studio.models.batch import batch_coords, batch_func
Expand Down Expand Up @@ -52,6 +53,15 @@
load_model_package = None
_cuda_extension_available = False

if Version(torch_harmonics.__version__) >= Version("0.8.1"):
from torch_harmonics.disco import cuda_kernels_is_available

_cuda_extension_available = cuda_kernels_is_available()
else:
from importlib.util import find_spec

_cuda_extension_available = find_spec("disco_cuda_extension") is not None
Comment on lines +56 to +63
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated version check logic - same code appears in lines 38-50 inside the try block



VARIABLES = [
"u10m",
Expand Down
15 changes: 15 additions & 0 deletions recipes/tc_tracking/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info
outputs*/
*.zarr
*.nc
*.gif
.python-version

# Virtual environments
.venv
35 changes: 35 additions & 0 deletions recipes/tc_tracking/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM nvcr.io/nvidia/physicsnemo/physicsnemo:25.11

# update repo info
RUN apt update -y && \
apt install -y libibmad5 unixodbc && \
apt install -y netcdf-bin libnetcdf-dev

# upgrade cmake
RUN apt remove cmake -y && \
pip install cmake --upgrade

# Install uv
RUN wget -qO- https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"
ENV CC=/usr/bin/gcc
ENV CXX=/usr/bin/g++

# install TempestExtremes
WORKDIR /
RUN git clone https://github.com/ClimateGlobalChange/tempestextremes.git && \
mkdir -p /tempestextremes/build
WORKDIR /tempestextremes/build
RUN cmake .. && \
make -j && \
cp ./bin/DetectNodes /usr/local/bin && \
cp ./bin/StitchNodes /usr/local/bin

# copy source into the container.
RUN mkdir -p /tc_tracking_src
COPY . /tc_tracking_src
WORKDIR /tc_tracking_src

ENV FORCE_CUDA_EXTENSION=1
ENV TORCH_CUDA_ARCH_LIST="8.0 8.6 9.0 10.0 12.0, 13.0+PTX"
RUN uv pip install --system --break-system-packages --no-cache-dir .
116 changes: 116 additions & 0 deletions recipes/tc_tracking/PR_SPLIT_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Splitting the TC Tracking Recipe into Incremental PRs

Breakdown into 4 PRs, ordered from foundational to supplementary. Each PR is self-contained and reviewable on its own.

---

## PR 1 -- Core infrastructure + `generate_ensemble` mode

The bulk of the code. Introduces the full pipeline for running AI weather model ensembles and tracking tropical cyclones with TempestExtremes.

**Files to include:**

- `tc_hunt.py` -- entry point, but only dispatching `generate_ensemble` (no import of `baseline_extraction`, no `reproduce_members` dispatch)
- `src/__init__.py`
- `src/tempest_extremes.py` -- the full TempestExtremes + async wrapper (~1250 lines, core of the recipe)
- `src/utils.py` -- shared helpers
- `src/data/utils.py` -- `DataSourceManager`, `load_heights`
- `src/data/file_output.py` -- output setup for Zarr/NetCDF
- `src/modes/generate_ensembles.py` -- **full file including `reproduce_members`**. Since `reproduce_members` and `generate_ensemble` share `initialise`, `load_model`, `run_inference`, `distribute_runs`, and `configure_runs`, splitting the file would be artificial. The function simply sits unused until PR 2 wires it up.
- `cfg/helene.yaml`, `cfg/hato.yaml` -- example configs for tracking
- `pyproject.toml` -- **without `tropycal`** (only needed by baseline extraction in PR 3)
- `Dockerfile`, `set_envs.sh`, `.gitignore`
- `README.md` -- documenting only the `generate_ensemble` mode
- `test/test_tc_hunt.sh`, `test/cfg/baseline_helene.yaml`, `test/README.md`, `test/.gitignore` -- basic test for the generate mode

**Notes:**

- This is the largest PR but it is all one coherent feature: "run ensemble forecasts and track cyclones".
- `tropycal`, `moviepy`, and plotting-only dependencies can be dropped from `pyproject.toml` for this PR to keep the dependency surface small.
- The `testsource.py` debug script is not part of the recipe proper; leave it out (it is an untracked file anyway).

---

## PR 2 -- Reproduction mode

A very small, easy-to-review PR. Wires up the `reproduce_members` function that already exists in `generate_ensembles.py`.

**Changes:**

- `tc_hunt.py` -- add `reproduce_members` import and dispatch case (~3 lines changed)
- `cfg/reproduce_helene.yaml` -- example config for reproducing specific ensemble members
- `test/cfg/reproduce_helene.yaml` -- test config
- `README.md` -- add documentation for the `reproduce_members` mode

This PR is intentionally tiny. The only new logic is the dispatch wiring and configs; the implementation already landed in PR 1 as part of `generate_ensembles.py`.

---

## PR 3 -- Baseline extraction from reanalysis

Adds the `extract_baseline` mode, which fetches ERA5 reanalysis data, runs TempestExtremes on it, and matches the detected tracks against IBTrACS ground truth.

**Files to include:**

- `src/modes/baseline_extraction.py` -- the full extraction pipeline (~208 lines)
- `tc_hunt.py` -- add `extract_baseline` import and dispatch case
- `cfg/extract_era5.yaml` -- config for Helene + Hato extraction
- `aux_data/ibtracs.HATO_HELENE.list.v04r01.csv` -- IBTrACS subset
- `aux_data/reference_track_hato_2017_west_pacific.csv` -- reference track
- `aux_data/reference_track_helene_2024_north_atlantic.csv` -- reference track
- `test/test_historic_tc_extraction.sh`, `test/cfg/extract_era5.yaml` -- extraction test
- `pyproject.toml` -- add `tropycal>=1.4` dependency
- `README.md` -- add documentation for `extract_baseline`

**Notes:**

- This is the only PR that adds `tropycal` as a dependency (used for IBTrACS access).
- The `aux_data/` CSV files are small reference datasets, fine to commit.

---

## PR 4 -- Plotting and analysis tools

Adds the visualisation and analysis tooling. Entirely optional for the core pipeline to work; can be merged last or even deferred.

**Files to include:**

- `plotting/analyse_n_plot.py`
- `plotting/data_handling.py`
- `plotting/plotting_helpers.py`
- `plotting/plot_tracks_n_fields.ipynb`
- `plotting/tracks_slayground.ipynb`
- `plotting/README.md`
- `plotting/.gitignore`
- `pyproject.toml` -- ensure `cartopy`, `matplotlib`, `moviepy` are present (likely already there from PR 1, but verify)

---

## Dependency flow between PRs

```mermaid
graph LR
PR1["PR 1: Core + generate_ensemble"]
PR2["PR 2: reproduce_members"]
PR3["PR 3: extract_baseline"]
PR4["PR 4: Plotting"]
PR1 --> PR2
PR1 --> PR3
PR1 --> PR4
PR3 --> PR4
```

PR 2, PR 3, and PR 4 all depend on PR 1. PR 3 and PR 4 are independent of PR 2. PR 4 may reference outputs from PR 3 (reference tracks), so ordering PR 3 before PR 4 is ideal but not strictly required.

---

## Implementation approach

For each PR, we create a branch off main and stage only the relevant files. Since all files are new (no modifications to existing e2s files), this is straightforward -- each PR is a subset of the current `recipes/tc_tracking/` directory. The main work is:

1. For PR 1: temporarily strip `tc_hunt.py` to only handle `generate_ensemble`, and trim `pyproject.toml` dependencies.
2. For PR 2: minimal diff -- add 3 lines to `tc_hunt.py` + config files.
3. For PR 3: add `baseline_extraction.py` + wiring + configs + aux data + tropycal dep.
4. For PR 4: add `plotting/` directory.

Each subsequent PR is a clean additive diff on top of the previous one.
Loading