Skip to content

Commit

Permalink
Add atlas v1 (#247)
Browse files Browse the repository at this point in the history
* update director for atlas

* added atlas-v1

* clean up roocs.ini

* added atlas v1 smoke tests

* clean up
  • Loading branch information
cehbrecht authored Jan 17, 2024
1 parent 5a3dfba commit 821d2cb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 19 deletions.
7 changes: 5 additions & 2 deletions rook/director/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def __init__(self, coll, inputs):
self.inputs = inputs

self.project = get_project_name(coll[0])
# self.project = "c3s-cmip6"

self.use_original_files = False
self.original_file_urls = None
Expand Down Expand Up @@ -93,7 +92,11 @@ def _resolve(self):
raise InvalidCollection()

# If original files are requested then go straight there
if self.inputs.get("original_files") or self.project == "c3s-ipcc-atlas":
if (
self.inputs.get("original_files")
or self.project == "c3s-ipcc-atlas"
or self.project == "c3s-cica-atlas"
):
self.original_file_urls = self.search_result.download_urls()
self.use_original_files = True
return
Expand Down
17 changes: 0 additions & 17 deletions rook/etc/roocs.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
[rook]

[project:c3s-ipcc-atlas]
project_name = c3s-ipcc-atlas
base_dir = /mnt/lustre/work/ik1017/C3SATLAS/data/c3s-ipcc-ar6-atlas
is_default_for_path = True
# https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/CMIP5/rcp45/fd_CMIP5_rcp45_mon_200601-210012.nc
# https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/CMIP6/historical/tnn_CMIP6_historical_mon_185001-201412.nc
# https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/CORDEX-AFR/historical/pr_CORDEX-AFR_historical_mon_197001-200512.nc
file_name_template = {__derive__var_id}_{project}_{experiment}_{time_frequency}_{__derive__time_range}{extra}.{__derive__extension}
attr_defaults =
time_frequency:no-freq
experiment:no-expt
facet_rule = variable project experiment time_frequency
mappings =
project:project_id
use_catalog = True
data_node_root = https://data.mips.copernicus-climate.eu/thredds/fileServer/esg_c3s-ipcc-atlas/
39 changes: 39 additions & 0 deletions tests/smoke/test_smoke_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@

C3S_IPCC_ATLAS_CORDEX_COLLECTION = "c3s-ipcc-atlas.tnn.CORDEX-AFR.historical.mon"

C3S_CICA_ATLAS_ERA5_COLLECTION = "c3s-cica-atlas.cd.ERA5.yr"

C3S_CICA_ATLAS_CORDEX_COLLECTION = "c3s-cica-atlas.cdd.CORDEX-CORE.historical.yr"

C3S_CICA_ATLAS_CMIP6_COLLECTION = "c3s-cica-atlas.cd.CMIP6.historical.yr"

WF_C3S_CMIP5 = json.dumps(
{
"doc": "subset+average on cmip5",
Expand Down Expand Up @@ -663,3 +669,36 @@ def test_smoke_execute_c3s_ipcc_atlas_cordex_subset(wps):
urls = wps.execute("subset", inputs)
assert len(urls) == 1
assert "data.mips.copernicus-climate.eu" in urls[0]


def test_smoke_execute_c3s_cica_atlas_cmip6_subset(wps):
inputs = [
("collection", C3S_CICA_ATLAS_CMIP6_COLLECTION),
# ("time", "2000-01-01/2000-12-30"),
# ("original_files", "1"),
]
urls = wps.execute("subset", inputs)
assert len(urls) == 1
assert "data.mips.copernicus-climate.eu" in urls[0]


def test_smoke_execute_c3s_cica_atlas_cordex_subset(wps):
inputs = [
("collection", C3S_CICA_ATLAS_CORDEX_COLLECTION),
# ("time", "2000-01-01/2000-12-30"),
# ("original_files", "1"),
]
urls = wps.execute("subset", inputs)
assert len(urls) == 1
assert "data.mips.copernicus-climate.eu" in urls[0]


def test_smoke_execute_c3s_cica_atlas_era5_subset(wps):
inputs = [
("collection", C3S_CICA_ATLAS_ERA5_COLLECTION),
# ("time", "2000-01-01/2000-12-30"),
# ("original_files", "1"),
]
urls = wps.execute("subset", inputs)
assert len(urls) == 1
assert "data.mips.copernicus-climate.eu" in urls[0]

0 comments on commit 821d2cb

Please sign in to comment.