FuXi-RTM / README.md
qiusheng's picture
Fix RTM_tar_gz description: RRTMG outputs for MLRTM training/test, not ERA5
4d160f8 verified
|
Raw
History Blame Contribute Delete
8.42 kB
---
license: mit
task_categories:
- time-series-forecasting
tags:
- weather
- climate
- radiation
- radiative-transfer
- FuXi
- FuXi-RTM
- MLRTM
- RRTMG
pretty_name: FuXi-RTM Inference Results
size_categories:
- 1B<n<10B
---
# FuXi-RTM Inference Dataset
This dataset contains the inference results of the **FuXi-RTM** family of models — global medium-range weather forecasting systems with explicit shortwave radiation prediction. We release per–initialization-time forecast bundles produced by three model variants, plus the **RRTMG-generated shortwave radiation training/test set** used to fit the MLRTM neural radiation emulator.
The companion inference script (`infer_onnx_release.py`) is included so users can reproduce the rollouts on their own initial conditions.
## Repository Layout
```
qiusheng/FuXi-RTM/
├── README.md
├── infer_onnx_release.py # ONNX Runtime inference script
├── data_util.py # Data I/O helpers used by the inference script
├── test.onnx # Small example model file for quick smoke tests
├── RTM_base_6h_tar_gz/ # → Inference results from FuXi-base
├── RTM_mlp_6h_tar_gz/ # → Inference results from FuXi-base+ (MLP head)
├── RTM_exp_re4_6h_tar_gz/ # → Inference results from FuXi-RTM (full model)
└── RTM_tar_gz/ # → RRTMG shortwave outputs (training/test data for MLRTM)
```
## Model → Folder Mapping
The three forecast directories share an identical layout (same 80 initialization times, same internal structure) so they can be compared side-by-side with simple folder-swapping in your evaluation pipeline.
| Folder | Source Model | Description |
|---|---|---|
| `RTM_base_6h_tar_gz/` | **FuXi-base** | Baseline FuXi global forecasting model. Predicts standard atmospheric prognostic variables only (no radiation outputs). Serves as the reference baseline for ablations. |
| `RTM_mlp_6h_tar_gz/` | **FuXi-base+ (MLP)** | FuXi-base extended with a lightweight **MLP head** that diagnoses surface shortwave radiation fluxes from the predicted atmospheric state. A simpler, cheaper alternative to the full RTM model. |
| `RTM_exp_re4_6h_tar_gz/` | **FuXi-RTM** | The full FuXi-RTM model with an integrated **Radiative Transfer Module (RTM)**. Jointly predicts atmospheric prognostics and physically-consistent shortwave radiation fluxes. This is the headline model of the paper. |
| `RTM_tar_gz/` | *(physics-model output, not a NN forecast)* | **RRTMG** shortwave radiation fields (`ssrd`, `swdflx`, `swdflxc`, `swuflx`, `swuflxc`) for **2017–2018**. Generated offline by running the RRTMG radiative-transfer scheme; used as the **training and test data for the MLRTM neural emulator**. |
## File Naming Convention
Each forecast file is named after its **initialization datetime** (起报时刻), not a forecast step:
```
YYYYMMDDHH.tar.gz → one full forecast trajectory launched at that init time
```
For example, `2024010112.tar.gz` contains **the entire multi-step rollout launched from 2024-01-01 12:00 UTC** — i.e. all lead times (T+6h, T+12h, …, up to the configured `--total_step`) for that single initialization. To evaluate a model at, say, the 72-hour lead time, you read the corresponding step inside each per-init archive and pair it against the verifying analysis.
### Sampling Strategy
Per-init forecast bundles are **~9 GB each**. To stay within the Hugging Face free-tier storage budget, we release a temporally-thinned subset:
- **80 initialization times per folder**
- **One init per day, every 5 days, at 12 UTC**
- **Date range: 2024-01-01 → 2025-02-19**
> **Need denser cadence or the full archive?** Open a discussion on this dataset page or contact the authors — we are happy to release more on demand.
## Inner Data Structure of Each `.tar.gz`
After extraction, each archive expands to a per-init directory whose contents follow the layout produced by `infer_onnx_release.py`:
```
<init_time>/ # e.g. 2024010112/
├── 1.zarr/ ← lead step 1 (T+6h if --hour_interval 6)
├── 2.zarr/ ← lead step 2 (T+12h)
├── 3.zarr/ ← lead step 3 (T+18h)
├── ...
└── N.zarr/ ← lead step N
```
- **Format:** [Zarr v2](https://zarr.readthedocs.io/) directory stores (one per lead step). Use the `--save_type nc` flag in the inference script if you prefer NetCDF.
- **Tensor dimensions:** `(time, channel, lat, lon)`
- **Temporal cadence:** 6-hourly (matches the `_6h_` in the folder name)
- **Multi-member ensembles** (when produced with `--total_member > 1`) follow the pattern `m<member_id>_<step>.zarr`.
### `RTM_tar_gz/` — RRTMG training/test data for MLRTM
This directory contains shortwave radiation fields produced by running the **RRTMG** (Rapid Radiative Transfer Model for GCMs) radiative-transfer scheme offline. It is the **training and test set for the MLRTM neural radiation emulator**, *not* a forecasting result.
Files are organized by variable and year:
| File | Variable | Description |
|---|---|---|
| `ssrd_<year>.tar.gz` | `ssrd` | Surface solar radiation downwards (single-level, all-sky) |
| `swdflx_<year>.tar.gz` | `swdflx` | Shortwave **downward** flux profile, **all-sky** |
| `swdflxc_<year>.tar.gz` | `swdflxc` | Shortwave **downward** flux profile, **clear-sky** |
| `swuflx_<year>.tar.gz` | `swuflx` | Shortwave **upward** flux profile, **all-sky** |
| `swuflxc_<year>.tar.gz` | `swuflxc` | Shortwave **upward** flux profile, **clear-sky** |
- Years released: **2017** (training) and **2018** (testing).
- All-sky / clear-sky pairs let the emulator learn cloud radiative effects as a residual.
## How to Use
### 1. Download
```bash
pip install huggingface_hub
hf download --repo-type dataset qiusheng/FuXi-RTM \
--include "RTM_exp_re4_6h_tar_gz/2024010112.tar.gz" \
--local-dir ./fuxi_rtm
```
Or pull the whole dataset (≈ several TB; not recommended unless you really need it):
```bash
hf download --repo-type dataset qiusheng/FuXi-RTM --local-dir ./fuxi_rtm
```
### 2. Extract a forecast bundle
```bash
mkdir -p forecasts && tar -xzf fuxi_rtm/RTM_exp_re4_6h_tar_gz/2024010112.tar.gz -C forecasts/
```
### 3. Read with `xarray`
```python
import xarray as xr
ds = xr.open_zarr("forecasts/2024010112/24.zarr") # 24 × 6h = T+144h forecast
print(ds)
```
## Reproducing the Inference
The included `infer_onnx_release.py` is the exact script used to produce these archives.
### Dependencies
```bash
pip install numpy xarray pandas onnxruntime-gpu # or onnxruntime (CPU)
```
### Basic usage
```bash
python infer_onnx_release.py \
--model <model.onnx> \
--input <era5_initial_conditions/> \
--save_dir <output_dir> \
--total_step 400 \
--hour_interval 6
```
### Key arguments
| Argument | Default | Description |
|---|---|---|
| `--model` | `exps/RTM_onnx/base_tf/model/test.onnx` | Path to ONNX model file |
| `--input` | `datasets/era5.rtm.02_25.6h.c109.new3/` | Input data path (NetCDF/Zarr) |
| `--save_dir` | `eval/save` | Output directory |
| `--save_type` | `zarr` | `nc` or `zarr` |
| `--device` | `cuda` | `cuda` or `cpu` |
| `--dtype` | `fp32` | `fp16` or `fp32` |
| `--batch_size` | `1` | Number of parallel processes (>1 enables multi-process mode) |
| `--total_step` | `400` | Total prediction steps |
| `--total_member` | `1` | Number of ensemble members |
| `--hour_interval` | `6` | Time interval (hours) |
| `--time_splite` | `20240101 20250531` | Time range |
| `--init_time_hour` | `0 12` | Initialization hours |
### Execution modes
- **Single-process** (`--batch_size 1`): sequential rollout — useful for debugging or limited GPU memory.
- **Multi-process** (`--batch_size N`): launches `N` independent worker processes, each loading the model and running one ensemble member in parallel.
### Input data requirements
- Format: Zarr or NetCDF.
- Dimensions: `(time, channel, lat, lon)`.
- Must include `mean.nc` and `std.nc` files for input normalization / output denormalization.
## Citation
If you use this dataset, please cite the FuXi-RTM paper (citation block to be added on publication).
## License
Released under the MIT license.
## Contact
Questions, denser-cadence requests, or issues with the data — please open a discussion on this dataset page.