Skip to content

Commit 703f0d1

Browse files
committed
Add latest eORCA12 ERA5v1 5d outputs and domain_cfg to noc-model-stac and remove legacy id_name constructors.
1 parent fdcec12 commit 703f0d1

2 files changed

Lines changed: 25 additions & 32 deletions

File tree

catalogs/npd_collections.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def create_npd_era5_collection() -> pystac.Collection:
393393
# Define the store credentials for the eORCA1 ERA5v1 NPD data:
394394
bucket = "npd-eorca1-era5v1"
395395
for prefix in ["T1y", "U1y", "V1y", "W1y", "I1y", "S1y", "T1m", "U1m", "V1m", "W1m", "I1m", "S1m",
396-
"domain/domain_cfg", "domain/mesh_mask", "domain/subbasins"
396+
"domain/domain_cfg"
397397
]:
398398
# Open dataset from Icechunk repository:
399399
ds = open_icechunk_store(bucket=bucket, prefix=prefix, branch="main")
@@ -414,6 +414,8 @@ def create_npd_era5_collection() -> pystac.Collection:
414414
bucket=bucket,
415415
platform="gn",
416416
prefix=prefix,
417+
start_date="1976-01-01",
418+
end_date="2025-07-31",
417419
config="eORCA1 ERA5v1 NPD",
418420
operation=operation,
419421
)
@@ -436,6 +438,8 @@ def create_npd_era5_collection() -> pystac.Collection:
436438
bucket=bucket,
437439
platform="tn",
438440
prefix=prefix,
441+
start_date="1976-01-01",
442+
end_date="2025-07-31",
439443
config="eORCA1 ERA5v1 NPD",
440444
operation=operation,
441445
)
@@ -450,7 +454,7 @@ def create_npd_era5_collection() -> pystac.Collection:
450454
for prefix in ["T1y_3d", "T1y_4d", "U1y_3d", "U1y_4d", "V1y_3d", "V1y_4d", "W1y_4d", "I1y_3d", "S1y_1d",
451455
"T1m_3d", "T1m_4d", "U1m_3d", "U1m_4d", "V1m_3d", "V1m_4d", "W1m_4d", "I1m_3d", "S1m_1d",
452456
"T5d_3d", "T5d_4d", "U5d_3d", "U5d_4d", "V5d_3d", "V5d_4d", "I5d_3d", "S5d_1d",
453-
"domain/domain_cfg", "domain/mesh_mask", "domain/subbasins"
457+
"domain/domain_cfg"
454458
]:
455459
# Open dataset from Icechunk repository:
456460
ds = open_icechunk_store(bucket=bucket, prefix=prefix, branch="main")
@@ -471,6 +475,8 @@ def create_npd_era5_collection() -> pystac.Collection:
471475
bucket=bucket,
472476
platform="gn",
473477
prefix=prefix,
478+
start_date="1976-01-01",
479+
end_date="2025-07-31",
474480
config="eORCA025 ERA5v1 NPD",
475481
operation=operation,
476482
)
@@ -493,6 +499,8 @@ def create_npd_era5_collection() -> pystac.Collection:
493499
bucket=bucket,
494500
platform="tn",
495501
prefix=prefix,
502+
start_date="1976-01-01",
503+
end_date="2025-07-31",
496504
config="eORCA025 ERA5v1 NPD",
497505
operation=operation,
498506
)
@@ -506,6 +514,7 @@ def create_npd_era5_collection() -> pystac.Collection:
506514
bucket = "npd-eorca12-era5v1"
507515
for prefix in ["T1y_3d", "T1y_4d", "U1y_3d", "U1y_4d", "V1y_3d", "V1y_4d", "W1y_4d", "I1y_3d", "S1y_1d",
508516
"T1m_3d", "T1m_4d", "U1m_3d", "U1m_4d", "V1m_3d", "V1m_4d", "W1m_4d", "I1m_3d", "S1m_1d",
517+
"T5d_3d", "T5d_4d", "U5d_3d", "U5d_4d", "V5d_3d", "V5d_4d", "I5d_3d", "S5d_1d",
509518
"domain/domain_cfg",
510519
]:
511520
# Open dataset from Icechunk repository:
@@ -516,17 +525,25 @@ def create_npd_era5_collection() -> pystac.Collection:
516525
operation = "None None"
517526
elif '1y' in prefix:
518527
operation = "annual mean"
528+
start_date="1976-01-01"
529+
end_date="2024-12-31"
519530
elif '1m' in prefix:
520531
operation = "monthly mean"
532+
start_date="1976-01-01"
533+
end_date="2024-12-31"
521534
elif '5d' in prefix:
522535
operation = "5-day mean"
536+
start_date="1990-01-01"
537+
end_date="2024-12-31"
523538

524539
item = create_item_with_icechunk_asset(
525540
id=f"noc-npd-era5/{bucket}/gn/{prefix}",
526541
ds=ds,
527542
bucket=bucket,
528543
platform="gn",
529544
prefix=prefix,
545+
start_date=start_date,
546+
end_date=end_date,
530547
config="eORCA12 ERA5v1 NPD",
531548
operation=operation,
532549
)
@@ -549,6 +566,8 @@ def create_npd_era5_collection() -> pystac.Collection:
549566
bucket=bucket,
550567
platform="tn",
551568
prefix=prefix,
569+
start_date="1976-01-01",
570+
end_date="2024-12-31",
552571
config="eORCA12 ERA5v1 NPD",
553572
operation=operation,
554573
)

catalogs/utils.py

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def create_item_with_icechunk_asset(
134134
"""
135135
# Define the item description based on the prefix:
136136
if 'domain' in prefix:
137-
description = f"Icechunk repository containing {config} global ocean model {prefix.split('/')[-1]} variables."
137+
description = f"Icechunk repository containing {config} global ocean model domain and mesh mask variables."
138138
elif 'I' in prefix:
139139
description = f"Icechunk repository containing {config} global sea-ice {operation} outputs defined at T-points."
140140
elif 'S' in prefix:
@@ -156,19 +156,6 @@ def create_item_with_icechunk_asset(
156156
# Convert the Polygon to GeoJSON format:
157157
geometry = mapping(polygon)
158158

159-
# Define STAC Item ID:
160-
if 'domain' in prefix:
161-
id_name = f"{collection}/{bucket}/{platform}/{prefix.split('/')[-1]}"
162-
elif 'M' in prefix:
163-
id_name = f"{collection}/{bucket}/{platform}/{prefix.replace('/','-')}"
164-
else:
165-
if len(ds.data_vars) > 1:
166-
# Multiple variable Icechunk repository:
167-
id_name = f"{collection}/{bucket}/{platform}/{prefix}"
168-
else:
169-
# Single variable Icechunk repository:
170-
id_name = f"{collection}/{bucket}/{platform}/{prefix.replace('/','-')}"
171-
172159
# Create a STAC Item with Asset:
173160
item = pystac.Item(
174161
id=id,
@@ -199,7 +186,7 @@ def create_item_with_icechunk_asset(
199186
href=f"https://noc-msm-o.s3-ext.jc.rl.ac.uk/{bucket}/{prefix}",
200187
title=f"{config} {prefix} Icechunk repository",
201188
description=description,
202-
media_type="application/icechunk",
189+
media_type="application/vnd.zarr+icechunk",
203190
extra_fields=dict(
204191
bucket=bucket,
205192
prefix=prefix,
@@ -271,7 +258,7 @@ def create_item_with_zarr_asset(
271258
var = f"{prefix.split('/')[-1]} output" if variable_stores else "outputs"
272259

273260
if 'domain' in prefix:
274-
description = f"Zarr store containing {config} global ocean model {prefix.split('/')[-1]} variables."
261+
description = f"Zarr store containing {config} global ocean model domain and mesh mask variables."
275262
elif 'I' in prefix:
276263
description = f"Zarr store containing {config} global sea-ice {operation} {var} defined at T-points."
277264
elif 'S' in prefix:
@@ -293,19 +280,6 @@ def create_item_with_zarr_asset(
293280
# Convert the Polygon to GeoJSON format:
294281
geometry = mapping(polygon)
295282

296-
# Define STAC Item ID:
297-
if 'domain' in prefix:
298-
id_name = f"{collection}/{bucket}/{platform}/{prefix.split('/')[-1]}"
299-
elif 'M' in prefix:
300-
id_name = f"{collection}/{bucket}/{platform}/{prefix.replace('/','-')}"
301-
else:
302-
if len(ds.data_vars) > 1:
303-
# Multiple variable Zarr Store:
304-
id_name = f"{collection}/{bucket}/{platform}/{prefix}"
305-
else:
306-
# Single variable Zarr Store:
307-
id_name = f"{collection}/{bucket}/{platform}/{prefix.replace('/','-')}"
308-
309283
# Create a STAC Item with Asset:
310284
item = pystac.Item(
311285
id=id,
@@ -335,7 +309,7 @@ def create_item_with_zarr_asset(
335309
href=f"https://noc-msm-o.s3-ext.jc.rl.ac.uk/{bucket}/{prefix}",
336310
title=f"{config} {prefix} Zarr store.",
337311
description=description,
338-
media_type="application/vnd+zarr",
312+
media_type="application/vnd.zarr",
339313
extra_fields=dict(
340314
bucket=bucket,
341315
prefix=prefix,

0 commit comments

Comments
 (0)