From 2e4a48dd4c863947abbe479216cf7f3dc9741bb1 Mon Sep 17 00:00:00 2001 From: Cornelius Tai Date: Mon, 6 Jul 2026 13:56:48 +0200 Subject: [PATCH 1/4] Include icontoolbox --- .gitmodules | 3 +++ artist/icontoolbox | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 artist/icontoolbox diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..754593d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "artist/icontoolbox"] + path = artist/icontoolbox + url = https://github.com/tppcc/icontoolbox.git diff --git a/artist/icontoolbox b/artist/icontoolbox new file mode 160000 index 0000000..a47dd15 --- /dev/null +++ b/artist/icontoolbox @@ -0,0 +1 @@ +Subproject commit a47dd1544a4ee50d8a4b872eb3663a857c9ec902 From 34526bfc4c27a555102dc310e51b43f28b3855a4 Mon Sep 17 00:00:00 2001 From: Cornelius Tai Date: Mon, 6 Jul 2026 14:26:18 +0200 Subject: [PATCH 2/4] Wrapper for IFS4ICON --- artist/preprocessing.py | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 artist/preprocessing.py diff --git a/artist/preprocessing.py b/artist/preprocessing.py new file mode 100644 index 0000000..470b79e --- /dev/null +++ b/artist/preprocessing.py @@ -0,0 +1,45 @@ +import icontoolbox as ic +import os +import xarray as xr + +""" +Wrapper for icontoolbox submodule +Author: Cornelius Tai + + +""" + + +def IFS4ICON( + init_date, + remap_nml=None, + output_grid=None, + output_path=None, + config_yaml=None, + iconremap_bin="/home/b/b382290/vol_work/icon_tools/dwd_icon_tools/icontools/iconremap", +): + """ + Wrapper function of icontoolbox.IFS4ICON(), which is shipped with this package as submodule. It is a 1 stop solution to prepare for ICON initialisation using IFS data (initicon_nml::init_mode = 2). + This function is designed to be used on levante, where a subset of ERA5 renalysis is stored. 3 additional variables are downloaded via the cdsapi, see: https://cds.climate.copernicus.eu/how-to-api for detailed setup of the cdsapi. + Requirements: + - cdsapi + - cdo (Climate Data Operator) + + Input: + init_date (str) : date of the reanalysis, format YYYY-MM-DD + remap_nml (list, str) : List of paths to Namelist files for iconremap tool, format [NAMELIST_REMAP, NAMELIST_INPUT_FIELD], default: None -> namelist will be constructed based on parameters passed + output_grid (str) : path to destination ICON grid file + output_path (str) : path to the directory where the output files will be stored, default: None -> os.getcwd() + config_yaml (str) : path to the configuration YAML file for Namelist construction, default: None -> use default configuration + iconremap_bin (str) : path to the iconremap binary, default: /home/b/b382290/vol_work/icon_tools/dwd_icon_tools/icontools/iconremap + """ + + return ic.IFS4ICON( + init_date=init_date, + remap_nml=remap_nml, + output_grid=output_grid, + output_path=output_path, + config_yaml=config_yaml, + iconremap_bin=iconremap_bin, + ) + From be7198cdd8e8a02af37bd539621d08234148f2e1 Mon Sep 17 00:00:00 2001 From: Cornelius Tai Date: Wed, 8 Jul 2026 13:30:36 +0200 Subject: [PATCH 3/4] updated init --- artist/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artist/__init__.py b/artist/__init__.py index 9e741be..da10978 100644 --- a/artist/__init__.py +++ b/artist/__init__.py @@ -1,2 +1,3 @@ from .utils import PlotAccessor -from .accessor import IconAccessor, GridAccessor \ No newline at end of file +from .accessor import IconAccessor, GridAccessor +from .preprocessing import IFS4ICON \ No newline at end of file From ff678d03a076b3c6277ee820751fd868cf6c7363 Mon Sep 17 00:00:00 2001 From: Cornelius Tai Date: Thu, 9 Jul 2026 10:02:30 +0200 Subject: [PATCH 4/4] included mac DS_Store into gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3e8efd0..378793c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ mie.ipynb *.csv +.DS_Store + # Byte-compiled / optimized / DLL files __pycache__/