Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Add further configuration for ATLAS projects #113

Merged
merged 4 commits into from
Feb 5, 2024
Merged
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
5 changes: 5 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ Co-Developers
* Eleanor Smith [email protected] `@ellesmith88 <https://github.com/ellesmith88>`_
* Carsten Ehbrecht [email protected]
* Pascal Bourgault [email protected]

Contributors
------------

* Martin Schupfner <[email protected]> `@sol1105 <https://github.com/sol1105>`_
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Next

* ...


v0.6.7 (unreleased)
-------------------

Other Changes
^^^^^^^^^^^^^
* Updated `roocs.ini` default values for atlas datasets for further methods of how to infer the project name (#113).

v0.6.6 (2024-01-26)
-------------------

Expand Down
41 changes: 41 additions & 0 deletions roocs_utils/etc/roocs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@ mappings =
project:project_id
data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/

[project:c3s-ipcc-ar6-atlas]
base_dir = /pool/data/c3s-ipcc-ar6-atlas
use_inventory = True
use_catalog = True
is_default_for_path = True
file_name_template = {__derive__var_id}_{source}_{experiment_id}_{frequency}{__derive__time_range}{extra}.{__derive__extension}
attr_defaults =
frequency:no-freq
experiment_id:no-expt
facet_rule = variable project experiment time_frequency
mappings =
project:project_id
data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/

[project:ipcc-ar6-interactive-atlas-dataset]
base_dir = /pool/data/c3s-ipcc-ar6-atlas
use_inventory = True
use_catalog = True
is_default_for_path = True
file_name_template = {__derive__var_id}_{source}_{experiment_id}_{frequency}{__derive__time_range}{extra}.{__derive__extension}
attr_defaults =
frequency:no-freq
experiment_id:no-expt
facet_rule = variable project experiment time_frequency
mappings =
project:product
data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/

[project:c3s-cica-atlas]
base_dir = /pool/data/c3s-cica-atlas
use_inventory = True
Expand All @@ -174,6 +202,19 @@ mappings =
project:project_id
data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cica-atlas/

[project:copernicus -interactive-climate-atlas-dataset]
base_dir = /pool/data/c3s-cica-atlas
use_inventory = True
use_catalog = True
is_default_for_path = True
file_name_template = {__derive__var_id}_{source}_{experiment_id}_{frequency}{__derive__time_range}{extra}.{__derive__extension}
attr_defaults =
frequency:no-freq
experiment_id:no-expt
facet_rule = variable project experiment time_frequency
mappings =
project:product
data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-cica-atlas/

[environment]
OMP_NUM_THREADS=1
Expand Down
27 changes: 27 additions & 0 deletions tests/test_project_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,32 @@ def test_get_project_name(load_test_data):
project = get_project_name(dset)
assert project == "c3s-cmip6-decadal"

# TODO: This needs to be cleaned up by introducing aliases and/or multiple mapping facets.
# Each project should be defined only once in the roocs.ini.
# Currently, without the possibility to define aliases, this is not possible
# for the ATLAS projects, because the web prefix, the project name in the DRS and the
# project name in the netCDF metadata differ from one another ...
#
# c3s-cica-atlas
dset = "c3s-cica-atlas.cd.CMIP6.historical.yr"
project = get_project_name(dset)
assert project == "c3s-cica-atlas"

# c3s-cica-atlas 2
dset = "/pool/data/c3s-cica-atlas/ERA5/psl_ERA5_mon_194001-202212.nc"
project = get_project_name(dset)
assert project == "c3s-cica-atlas"

# c3s-ipcc-ar6-atlas
dset = "c3s-ipcc-ar6-atlas.t.CORDEX-ANT.rcp45.mon"
project = get_project_name(dset)
assert project == "c3s-ipcc-ar6-atlas"

# c3s-ipcc-ar6-atlas
dset = "/pool/data/c3s-ipcc-ar6-atlas/CORDEX-ANT/rcp45/pr_CORDEX-ANT_rcp45_mon_200601-210012.nc"
project = get_project_name(dset)
assert project in ["c3s-ipcc-ar6-atlas", "c3s-ipcc-atlas"]


def test_get_project_name_badc():
dset = "/badc/cmip5/data/cmip5/output1/MOHC/HadGEM2-ES/rcp85/mon/atmos/Amon/r1i1p1/latest/tas/*.nc"
Expand Down Expand Up @@ -207,6 +228,12 @@ def test_derive_dset():

assert ds_id == "/pool/data/c3s-cica-atlas/cd/CMIP6/historical/yr"

# c3s-ipcc-ar6-atlas
dset = "c3s-ipcc-ar6-atlas.cd.CMIP6.historical.yr"
ds_id = derive_dset(dset)

assert ds_id == "/pool/data/c3s-ipcc-ar6-atlas/cd/CMIP6/historical/yr"


def test_switch_dset():
dset = "/badc/cmip6/data/CMIP6/CMIP/MIROC/MIROC6/historical/r1i1p1f1/SImon/siconc/gn/latest/*.nc"
Expand Down
Loading