Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
a430e8c
add basic example for regridding using scipy
PetarStam Apr 10, 2025
1821bb1
rename and delete comments
PetarStam Apr 10, 2025
0585383
start a branch for transfering corrdiff from nvidia-modulus
PetarStam Apr 10, 2025
99d55df
add model and loss scripts
PetarStam Apr 11, 2025
1f404b3
add utils and change imports
PetarStam Apr 11, 2025
3b172cc
restructure file system and add pyproject.toml
PetarStam Apr 14, 2025
05e3a08
Delete src/hirad_gen.egg-info directory
PetarStam Apr 14, 2025
dbf101e
add gitignore
PetarStam Apr 14, 2025
bb6288c
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
PetarStam Apr 14, 2025
5de83bc
add train script with missing parts
PetarStam Apr 16, 2025
134ed83
add abstract dataset class
PetarStam Apr 16, 2025
de4e7c5
adapt checkpoint saving and loading
PetarStam Apr 23, 2025
cff9da4
adapt checkpoint loading and saving
PetarStam Apr 25, 2025
1029d4c
fix model imports and dependency on module metadata
PetarStam Apr 25, 2025
a1daebe
add generate utils
PetarStam Apr 25, 2025
8164766
add sceleton for era5-cosmo dataset
PetarStam Apr 25, 2025
a9f7034
add in_channels to arg saving list
PetarStam Apr 25, 2025
e0059c8
add dataset era5_cosmo
PetarStam Apr 28, 2025
da4cb6c
fix imports
PetarStam Apr 28, 2025
c284d0a
add getitem to dataset
PetarStam Apr 29, 2025
e7d5b1b
add grid flip to start at top left corner
PetarStam Apr 29, 2025
d093e66
small fix
PetarStam Apr 29, 2025
7e695f0
update everything for training
PetarStam May 7, 2025
7510cf1
small fix
PetarStam May 7, 2025
75db04f
remove tracked .pyc files
PetarStam May 7, 2025
4b5ecb4
add small loggign changes
May 9, 2025
3eb4d0a
adapt sbatch script to slurm config
May 9, 2025
9aaea9d
adapt era5cosmo loader to trim_edge 19
May 9, 2025
dca7ff4
add inference
PetarStam May 12, 2025
8ba0c5a
Plot absolute error onto a projection for a given date
May 12, 2025
c6e632a
Adjust how reshaping is done before error calcs
May 12, 2025
d21ec35
plot for all channels, and against baseline
May 12, 2025
5b32566
Add MAE output
May 13, 2025
60c8aff
Fix indexing error
May 13, 2025
032492d
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
May 13, 2025
5cc42e9
Try adding spectral graph
May 14, 2025
5b77dbe
fix inference for diffusion
May 15, 2025
53e2033
Merge remote-tracking branch 'origin/corr-diff' into corr-diff
May 15, 2025
83716f4
clean up
May 15, 2025
69f10dd
Add power spectrum plots
May 15, 2025
5a4eb3f
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
May 15, 2025
b4c97c5
clean up a bit
May 15, 2025
90c7e28
clean up a bit
May 15, 2025
a905602
add readme for training
May 15, 2025
d2a1200
Merge remote-tracking branch 'origin/corr-diff' into corr-diff
May 15, 2025
57e2b35
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
May 16, 2025
573dc23
update readme for inference
May 16, 2025
4abed05
Merge remote-tracking branch 'origin/corr-diff' into corr-diff
May 16, 2025
f4d856b
small fix for inference on multiple time steps
May 16, 2025
dcc2a06
enable validation during training
May 21, 2025
cadccd5
change generate eval to new functions
May 22, 2025
92b08b7
fix average training loss tracking
May 23, 2025
97970fc
fix validation bug
May 23, 2025
937e7c9
update to latest corrdiff version
May 26, 2025
5db5e47
small config fix
May 26, 2025
e8bd5cd
fix generation on distributed
May 27, 2025
692dfe2
delete unnecessary logging
May 27, 2025
f16b71d
add patch_num fix to loss calcualtion
Jun 5, 2025
4337ba5
add log scale for precipitation plotting
Jun 12, 2025
a3ba452
Merge remote-tracking branch 'origin/main' into corr-diff
Jun 12, 2025
2ebf7e1
add missing loss sum
Jun 13, 2025
c63ca06
fix small things for merging
Jun 13, 2025
4a3a352
add crps code
Jun 16, 2025
eb408f0
restructure utils
Jun 17, 2025
054bdf4
restructure inference utils and samplers
Jun 17, 2025
a02d5a7
refactor generation
Jul 1, 2025
be6170d
Add some initial CRPS code
Jul 1, 2025
833242b
Fixes to CRPS
Jul 2, 2025
68ab63e
Adds time capability to crps
Jul 2, 2025
8266015
Plot CRPS per channel
Jul 2, 2025
a89fa46
Adds plotting CRPS over time (not yet tested)
Jul 4, 2025
99b3b37
Add plotting CRPS across time as well as area.
Jul 8, 2025
88ee662
add visualization during training
Jul 8, 2025
9764cc4
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Jul 8, 2025
48ae52b
fix calculating crps only for diffusion output
Jul 9, 2025
b92abde
environment files
Jul 9, 2025
03386ed
small fix environment
Jul 9, 2025
f7a0b4d
Make some paths relative
Jul 11, 2025
0224692
Fix errors from merge process
Jul 11, 2025
9cf4d18
Move environments to ci/ directory
Jul 11, 2025
4829388
Update paths for CRPS plotting
Jul 11, 2025
07db9f3
Change slurm account to new project 🎉
Jul 14, 2025
36953f8
Starting plotting script
Jul 16, 2025
872ab70
add time point to logging
Jul 16, 2025
38d1d88
eval script
Jul 16, 2025
9743491
add ensemble mean MAE, and add a comparison plot over time
Jul 16, 2025
ebdec81
Do some extra plotting tests to ensure that CRPS reduces to MAE
Jul 16, 2025
02e8788
Remove superfluous plotting, now that we know CRPS reduvces to MAE
Jul 16, 2025
8401a24
fix filename
Jul 16, 2025
e0f9de8
Move script methods into script
Jul 16, 2025
2449db4
Cleanup eval script a bit
Jul 16, 2025
9aff703
Fully separate CRPS and MAE plots for long time ranges
Jul 16, 2025
20a2ad8
Minor improvements to plotting
Jul 16, 2025
734279f
Update paths to environment for training scripts
Jul 21, 2025
a618c2f
Make label opt argument
Jul 21, 2025
5fc44e6
Add test scripts/configs for regression, diffusion, and generation
Jul 21, 2025
284f778
Update CI to include regression test script
Jul 21, 2025
995e888
Test script should not be srun if it's going to work with ci/cd
Jul 24, 2025
ffc1bed
Try to directly run from cscs.yml
Jul 24, 2025
ebc1043
plot diurnal cycles of precip amount and wet-hour frequency over time…
leuty Jul 24, 2025
7470c99
add mlflow logging
Jul 25, 2025
df360fb
Merge remote-tracking branch 'origin/corr-diff' into corr-diff
Jul 25, 2025
0f3b0c6
mlflow init bug fix
Jul 25, 2025
3bc4cae
add option to continue same run mlflow
Jul 25, 2025
6ff06da
add separate visualization frequency setting
Jul 25, 2025
06c185f
add plots of temperature and windspeed
leuty Jul 25, 2025
02ab40a
Add script to plot the 99th all-hour percentile
leuty Jul 25, 2025
c8a3f77
add visualization logging option for mlflow
Jul 25, 2025
3d1347a
enable mlflow logging to remote server
Jul 28, 2025
678fbe9
fix logging bug for average loss
Jul 28, 2025
e7d6c6b
update readme
Jul 28, 2025
6a63bcd
fix indents in readme
Jul 28, 2025
f9b8c87
simplify cscs.yml to try to get ci/cd to run
Jul 28, 2025
a72bbfa
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Jul 28, 2025
79e3112
logs
leuty Jul 29, 2025
7a11785
mask out sea points
leuty Jul 30, 2025
e234528
Convert to xarray, still buggy
leuty Jul 30, 2025
12702b6
comment
leuty Jul 31, 2025
b537630
fix bug in std
leuty Jul 31, 2025
1873b58
add patched diffusion configs
Jul 31, 2025
3c6853b
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Jul 31, 2025
79c6f6c
small fixes
leuty Jul 31, 2025
001d5e2
New script to plot maps (#18)
leuty Aug 4, 2025
8efcedd
use more xarray
leuty Aug 4, 2025
99a0661
add histograms
leuty Aug 4, 2025
477140b
add percentile lines
leuty Aug 5, 2025
f79f95f
add plot for probability of exceedance
leuty Aug 5, 2025
e631235
label
leuty Aug 5, 2025
bc40b00
Merge remote-tracking branch 'upstream/corr-diff' into dcycles
leuty Aug 5, 2025
4904a53
rename
leuty Aug 5, 2025
58c6607
plot map of the 99th all-hour percentile
leuty Aug 5, 2025
588681a
plot mean
leuty Aug 5, 2025
3ca921c
Update model compilation
Aug 6, 2025
5212ef3
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Aug 6, 2025
f445342
turn on optimizations
Aug 6, 2025
062c8d8
add some common untility functions
leuty Aug 6, 2025
392637d
use get_channel_indices function
leuty Aug 6, 2025
4dbaae3
remove slurm account variables
Aug 6, 2025
fd8434e
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Aug 6, 2025
63bb3cb
put more constants in plotting, use land-mask from plotting
leuty Aug 6, 2025
6236e7e
re-use concat_and_group_diurnal
leuty Aug 6, 2025
489d0a6
remove unneeded function
leuty Aug 6, 2025
e2b1aec
cleanup dcycles
leuty Aug 6, 2025
3928d6e
cleanup
leuty Aug 6, 2025
0738df2
rename
leuty Aug 7, 2025
ecb686f
unify maps in one script and more stats
leuty Aug 7, 2025
622a36c
point to store
leuty Aug 7, 2025
42250be
conserve memory and cleanup
leuty Aug 7, 2025
df1bf72
Merge pull request #19 from leuty/dcycles
marymcglo Aug 13, 2025
66f429e
Merge branch 'main' into corr-diff
Aug 20, 2025
5990c98
Merge branch 'main' into corr-diff
Aug 20, 2025
2729654
remove dependencies from pyproject
Aug 25, 2025
8b53777
change conversion factor to get mm instead of cm
Aug 25, 2025
9fe0b69
add __init__ package for input_data
Aug 25, 2025
630086a
Clean up copernicus processing
Aug 25, 2025
a7a541f
Generalize copernicus script to work with grib/netcdf
Aug 26, 2025
4a963ee
add copy anemoi script for copying from catalogue
Aug 26, 2025
b984129
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Aug 26, 2025
fcef8fc
move anemoi script to input_data directory
Aug 26, 2025
41208b2
Set training parameters in configs; add input/output channel names se…
Aug 26, 2025
c6c52e7
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Aug 26, 2025
d28a8be
Enhance evaluation scripts to include regression predictions
Aug 26, 2025
5a5412e
one-off script to regrid copernicus data
Aug 27, 2025
7871876
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Aug 27, 2025
f1d7101
Add input_data dependencies to container
Aug 27, 2025
3642980
add grid variable
Aug 27, 2025
fe621ac
more on processing copernicus data
Sep 1, 2025
4aecb65
removing old file
Sep 1, 2025
5d12c4c
Log config into training script logs
Sep 1, 2025
0a28801
Make InfiniteSampler start from where it left off when resuming train…
Sep 9, 2025
19cc78b
Move model compilation after checkpoint loading and fix checkpoint to…
Sep 10, 2025
1d4865f
Refactor image_batching and image_fuse to handle input tensor dtype c…
Sep 10, 2025
4b574e8
Validate max_patch_per_gpu against batch_size_per_gpu
Sep 10, 2025
40d1792
Add method to load static variables
Sep 16, 2025
4d6b9cb
Add static variable config
Sep 16, 2025
ef4f82a
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Sep 16, 2025
bfe2b35
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Sep 16, 2025
3ed02fa
Add a script to check input data for missing/corrupt/nan data
Sep 18, 2025
9d858eb
Enhance ERA5_COSMO dataset class with static channels option and Box-…
Sep 19, 2025
caaa424
Add lead time label param in RegressionLoss for consistency and refac…
Sep 19, 2025
c2e3160
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Sep 19, 2025
7ecc3d9
fix bug in dataset initialization
Sep 19, 2025
b9a843e
Add a less heavyweight Dockerfile that doesn't use nvidia stuff, for …
Sep 24, 2025
3a1ae7c
Modifications to input data tests to optionally load the torch files
Sep 24, 2025
e77c61a
Scripts used to reprocess data for various runs
Sep 24, 2025
66e3fc9
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Sep 24, 2025
88dcc01
Add reprocessing script
Oct 2, 2025
425050f
add functionality to have hour of the day and month of the year embed…
Oct 2, 2025
d8090c3
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Oct 2, 2025
6a09fb6
update config to latest features
Oct 2, 2025
ba08752
remove scoringrules packeage, not installed
leuty Oct 8, 2025
febbfe8
put snapshot maps into own sbatch script
leuty Oct 8, 2025
778f52b
Eval More 10m winds (#23)
leuty Oct 9, 2025
9783e10
first draft of regridding REA-L-CH1
Oct 20, 2025
2d0d0f8
remove unused function
Oct 20, 2025
2aaa067
add conversion to geo coords
Oct 20, 2025
608b988
use plotting function from interpolate_baisic
Oct 21, 2025
705e652
pip install meteodata-lab
Oct 21, 2025
3a54d18
config file for REA-L-CH1
Oct 21, 2025
7e06e91
skeleton for realch1 interpolatoin task
Oct 21, 2025
3dcb088
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Oct 21, 2025
1829e93
Enhance generation process with randomized sampler over time.
Oct 22, 2025
019c3a6
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Oct 22, 2025
ae6d8ff
Wind eval streaming (#24)
leuty Oct 27, 2025
68c3ae8
some updates to regridding (still not working)
Oct 28, 2025
f5a4f79
Merge branch 'corr-diff' of https://github.com/MeteoSwiss/HiRAD-Gen i…
Oct 28, 2025
603f3d8
regridding is actually working now.
Oct 28, 2025
87c5206
skeleton of full regrid script
Oct 28, 2025
dd79f5e
Regridding REA-L-CH1 script complete
Oct 28, 2025
a5acccd
Add trim_edge functionality to regridding realch1
Oct 29, 2025
93b5a5f
do rea-l-ch1 regridding in batches to improve performance/memory usage
Oct 30, 2025
9f42baa
small refactoring and cleanup so it is easier to re-use era5-cosmo in…
Oct 30, 2025
7b9364f
bit more skeleton to new inteprolation
Nov 3, 2025
d2ca5e5
working script
Nov 4, 2025
d0b9c1f
changes to copernicus regrid
Nov 5, 2025
c9b0f37
config updates
Nov 5, 2025
72ecbde
updates to CRPS eval
Nov 7, 2025
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ pyrightconfig.json
*.torch
plots/*
*.npz
outputs/*

# conda
.conda/*
Expand All @@ -194,7 +195,9 @@ temp.zarr.sync*
src/hirad/eval/__pycache__/*
interpolate_basic.log
interpolated.torch
mlruns/
.secrets.env
out
core
*.png
*.nc
*.nc
96 changes: 47 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,20 @@

HiRAD-Gen is short for high-resolution atmospheric downscaling using generative models. This repository contains the code and configuration required to train and use the model.

## Installation (Alps)
[Setup clariden/santis](#setup-claridensantis)
[Regression training - clariden/santis](#run-regression-model-training-alps)
[Diffusion training - clariden/santis](#run-diffusion-model-training-alps)
[Inference - clariden/santis](#running-inference-on-alps)
[Installation - uenv/venv - deprecated](#installation-alps-uenvvenv---deprecated)

To set up the environment for **HiRAD-Gen** on Alps supercomputer, follow these steps:

1. **Start the PyTorch user environment**:
```bash
uenv start pytorch/v2.6.0:v1 --view=default
```

2. **Create a Python virtual environment** (replace `{env_name}` with your desired environment name):
```bash
python -m venv ./{env_name}
```

3. **Activate the virtual environment**:
```bash
source ./{env_name}/bin/activate
```

4. **Install project dependencies**:
```bash
pip install -e .
```

This will set up the necessary environment to run HiRAD-Gen within the Alps infrastructure.
## Setup clariden/santis container environment
Container environment setup needed to run training and inference experiments on clariden/santis is contained in this repository under `ci/edf/modulus_env.toml`. Image squash is on clariden/alps under `/capstor/scratch/cscs/pstamenk/hirad.sqsh`. All the jobs can be run using this environment without additional installations and setup.

## Training

### Run regression model training (Alps)

1. Script for running the training of regression model is in `src/hirad/train_regression.sh`.
1. Script for running the training of regression model is in `src/hirad/train_regression.sh`. Here, you can change the sbatch settings.
Inside this script set the following:
```bash
### OUTPUT ###
Expand All @@ -55,14 +38,9 @@ srun bash -c "
```
hydra:
run:
dir: your_path_to_save_training_output
dir: your_path_to_save_training_outputs
```
- In `training/era_cosmo_regression.yaml` set:
```
hp:
training_duration: number of samples to train for (set to 4 for debugging, 512 fits into 30 minutes on 1 gpu with total_batch_size: 4)
```
- In `dataset/era_cosmo.yaml` set the `dataset_path` if different from default.
- All other parameters for training regression can be changed in the main config file `training_era_cosmo_regression.yaml` and config files the main config is referencing (default values are working for debugging purposes).

3. Submit the job with:
```bash
Expand All @@ -72,8 +50,7 @@ sbatch src/hirad/train_regression.sh
### Run diffusion model training (Alps)
Before training diffusion model, checkpoint for regression model has to exist.

1. Script for running the training of diffusion model is in `src/hirad/train_diffusion.sh`.
Inside this script set the following:
1. Script for running the training of diffusion model is in `src/hirad/train_diffusion.sh`. Here, you can change the sbatch settings. Inside this script set the following:
```bash
### OUTPUT ###
#SBATCH --output=your_path_to_output_log
Expand All @@ -82,12 +59,6 @@ Inside this script set the following:
```bash
#SBATCH -A your_compute_group
```
```bash
srun bash -c "
. ./{your_env_name}/bin/activate
python src/hirad/training/train.py --config-name=training_era_cosmo_diffusion.yaml
"
```

2. Set up the following config files in `src/hirad/conf`:

Expand All @@ -97,14 +68,12 @@ hydra:
run:
dir: your_path_to_save_training_output
```
- In `training/era_cosmo_regression.yaml` set:
- In `training/era_cosmo_diffusion.yaml` set:
```
hp:
training_duration: number of samples to train for (set to 4 for debugging, 512 fits into 30 minutes on 1 gpu with total_batch_size: 4)
io:
regression_checkpoint_path: path_to_directory_containing_regression_training_model_checkpoints
```
- In `dataset/era_cosmo.yaml` set the `dataset_path` if different from default.
- All other parameters for training regression can be changed in the main config file `training_era_cosmo_diffusion.yaml` and config files the main config is referencing (default values are working for debugging purposes).

3. Submit the job with:
```bash
Expand Down Expand Up @@ -155,13 +124,42 @@ Finally, from the dataset, subset of time steps can be chosen to do inference fo

One way is to list steps under `times:` in format `%Y%m%d-%H%M` for era5_cosmo dataset.

The other way is to specify `times_range:` with three items: first time step (`%Y%m%d-%H%M`), last time step (`%Y%m%d-%H%M`), hour shift (int). Hour shift specifies distance in hours between closest time steps for specific dataset (6 for era_cosmo).

By default, inference is done for one time step `20160101-0000`
The other way is to specify `times_range:` with three items: first time step (`%Y%m%d-%H%M`), last time step (`%Y%m%d-%H%M`), hour shift (int). Hour shift specifies distance in hours between closest time steps for specific dataset.

- In `dataset/era_cosmo.yaml` set the `dataset_path` if different from default.
- In `dataset/era_cosmo_inference.yaml` set the `dataset_path` if different from default. Make sure that specified times or times_range is contained in dataset_path.

3. Submit the job with:
```bash
sbatch src/hirad/generate.sh
```
```

## MLflow logging

During training MLflow can be used to log metrics.
Logging config files for regression and diffusion are located in `src/hirad/conf/logging/`. Set `method` to `mlflow` and specify `uri` if you want to log on remote server, otherwise run will be logged locally in output directory. Other options can also be modified here.

## Installation (Alps uenv/venv) - deprecated

To set up the environment for **HiRAD-Gen** on Alps supercomputer, follow these steps:

1. **Start the PyTorch user environment**:
```bash
uenv start pytorch/v2.6.0:v1 --view=default
```

2. **Create a Python virtual environment** (replace `{env_name}` with your desired environment name):
```bash
python -m venv ./{env_name}
```

3. **Activate the virtual environment**:
```bash
source ./{env_name}/bin/activate
```

4. **Install project dependencies**:
```bash
pip install -e .
```

This will set up the necessary environment to run HiRAD-Gen within the Alps infrastructure.
24 changes: 14 additions & 10 deletions ci/cscs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ build_job:
stage: build
extends: .container-builder-cscs-gh200
variables:
DOCKERFILE: ci/docker/Dockerfile
DOCKERFILE: ci/docker/Dockerfile.ci

#test_job:
# stage: test
# extends: .container-runner-clariden-gh200
# image: $PERSIST_IMAGE_NAME
# script:
# - /opt/helloworld/bin/hello
# variables:
# SLURM_JOB_NUM_NODES: 2
# SLURM_NTASKS: 2
test_job:
stage: test
extends: .container-runner-clariden-gh200
image: $PERSIST_IMAGE_NAME
script:
- echo 'hello world'
# - pip install -e . --no-dependencies
# - python src/hirad/training/train.py --config-name=training_era_cosmo_regression_test.yaml
variables:
SLURM_JOB_NUM_NODES: 2
SLURM_NTASKS: 2
#SLURM_ACCOUNT: a161
#SBATCH_ACCOUNT: a161
15 changes: 15 additions & 0 deletions ci/docker/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM nvcr.io/nvidia/physicsnemo/physicsnemo:25.06

# setup
RUN apt-get update && apt-get install python3-pip python3-venv -y
RUN pip install --upgrade pip

# Install the rest of dependencies.
RUN pip install \
Cartopy==0.22.0 \
xskillscore





14 changes: 14 additions & 0 deletions ci/docker/Dockerfile.corrdiff
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM nvcr.io/nvidia/physicsnemo/physicsnemo:25.06

# setup
RUN apt-get update && apt-get install python3-pip python3-venv -y
RUN pip install --upgrade pip

# Install the rest of dependencies.
RUN pip install \
anemoi.datasets \
Cartopy==0.22.0 \
xskillscore \
scoringrules \
mlflow \
meteodata-lab
29 changes: 29 additions & 0 deletions ci/docker/Dockerfile.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Following some suggestions in https://meteoswiss.atlassian.net/wiki/spaces/APN/pages/719684202/Clariden+Alps+environment+setup

FROM ubuntu:22.04 as builder
#FROM nvcr.io/nvidia/pytorch:25.01-py3


# setup
RUN apt-get update && apt-get install python3-pip python3-venv -y
RUN pip install --upgrade \
pip
#ninja
#wheel
#packaging
#setuptools

# install the rest of dependencies
# TODO: Factor pydeps into a separate file(s)
# TODO: Add versions for things
RUN pip install \
anemoi-datasets \
cartopy \
matplotlib \
numpy \
pandas \
scipy \
torch



10 changes: 10 additions & 0 deletions ci/edf/modulus_env.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
image = "/capstor/scratch/cscs/pstamenk/hirad.sqsh"

mounts = ["/capstor", "/iopsstor", "/users"]

# The initial directory in the container.
workdir = "${PWD}"

[annotations]
com.hooks.aws_ofi_nccl.enabled = "true"
com.hooks.aws_ofi_nccl.variant = "cuda12"
2 changes: 1 addition & 1 deletion interpolate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#SBATCH --partition=postproc
#SBATCH --time=23:59:00

python src/input_data/interpolate_basic.py src/input_data/era-all.yaml src/input_data/cosmo-all.yaml /store_new/mch/msopr/hirad-gen/basic-torch/era5-cosmo-1h-all-channels/
python src/hirad/input_data/interpolate_basic.py src/hirad/input_data/era-all.yaml src/hirad/input_data/cosmo-all.yaml /store_new/mch/msopr/hirad-gen/basic-torch/era5-cosmo-1h-all-channels/
11 changes: 1 addition & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ authors = [
{ name="Petar Stamenkovic", email="petar.stamenkovic@meteoswiss.ch" }
]
readme = "README.md"
requires-python = ">=3.12"
#requires-python = ">=3.12"
license = {file = "LICENSE"}

dependencies = [
"cartopy>=0.24.1",
"cftime>=1.6.4",
"hydra-core>=1.3.2",
"matplotlib>=3.10.1",
"omegaconf>=2.3.0",
"tensorboard>=2.19.0",
"termcolor>=3.1.0",
"torchinfo>=1.8.0",
"treelib>=1.7.1"
]

[tool.setuptools]
Expand Down
12 changes: 12 additions & 0 deletions src/hirad/conf/compute_eval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
hydra:
job:
chdir: true
name: diffusion_era5_cosmo_7500000_test
run:
dir: ./outputs/generation/${hydra:job.name}

# Get defaults
defaults:
- _self_
# Dataset
- dataset/era_cosmo_inference
10 changes: 8 additions & 2 deletions src/hirad/conf/dataset/era_cosmo.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
type: era5_cosmo
dataset_path: /iopsstor/scratch/cscs/pstamenk/datasets/basic-torch/trim_19_full
validation_path: /iopsstor/scratch/cscs/pstamenk/datasets/basic-torch/trim_19_full/validation
dataset_path: /iopsstor/scratch/cscs/mmcgloho/run-1_2/train/
# dataset_path: /iopsstor/scratch/cscs/pstamenk/datasets/basic-torch/era5-cosmo-1h-all-channels
validation_path: /iopsstor/scratch/cscs/mmcgloho/run-1_2/validation/
input_channel_names: [2t, 10u, 10v, tcw, t_850, z_850, u_850, v_850, t_500, z_500, u_500, v_500, tp]
output_channel_names: [2t, 10u, 10v, tp]
static_channel_names: ['hsurf']
transform_channels: ['tp-box_cox_025']
n_month_hour_channels: 4
8 changes: 8 additions & 0 deletions src/hirad/conf/dataset/era_cosmo_inference.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: era5_cosmo
# dataset_path: /iopsstor/scratch/cscs/pstamenk/datasets/basic-torch/era5-cosmo-1h-linear-interpolation/validation
dataset_path: /iopsstor/scratch/cscs/mmcgloho/run-1_2/validation
input_channel_names: [2t, 10u, 10v, tcw, t_850, z_850, u_850, v_850, t_500, z_500, u_500, v_500, tp]
output_channel_names: [2t, 10u, 10v, tp]
static_channel_names: ['hsurf']
transform_channels: ['tp-box_cox_025']
n_month_hour_channels: 4
6 changes: 3 additions & 3 deletions src/hirad/conf/generate_era_cosmo.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
hydra:
job:
chdir: true
name: generation_full
name: diffusion_era5_cosmo_7500000_test
run:
dir: /iopsstor/scratch/cscs/pstamenk/outputs/${hydra:job.name}
dir: ./outputs/generation/${hydra:job.name}

# Get defaults
defaults:
- _self_
# Dataset
- dataset/era_cosmo
- dataset/era_cosmo_inference

# Sampler
- sampler/stochastic
Expand Down
20 changes: 20 additions & 0 deletions src/hirad/conf/generate_era_cosmo_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
hydra:
job:
chdir: true
name: generation_era5_cosmo_test
run:
dir: ./outputs/generation/${hydra:job.name}

# Get defaults
defaults:
- _self_
# Dataset
- dataset/era_cosmo_inference

# Sampler
- sampler/stochastic
#- sampler/deterministic

# Generation
- generation/era_cosmo_test
#- generation/patched_based
Loading