Skip to content
Open

Ct #1

Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mie.ipynb
*.csv
_oem_real_test/
.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "artist/icontoolbox"]
path = artist/icontoolbox
url = https://github.com/tppcc/icontoolbox.git
5 changes: 3 additions & 2 deletions artist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .__plot import PlotAccessor
from .accessor import IconAccessor, GridAccessor, OemAccessor, ArtDatasetAccessor, ArtAccessor
from .utils import PlotAccessor
from .accessor import IconAccessor, GridAccessor
from .preprocessing import IFS4ICON
1 change: 1 addition & 0 deletions artist/icontoolbox
Submodule icontoolbox added at a47dd1
45 changes: 45 additions & 0 deletions artist/preprocessing.py
Original file line number Diff line number Diff line change
@@ -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,
)