Skip to content

Commit 4b63b0e

Browse files
committed
feat(ecmwf): Realtime NL bounds update
1 parent 75600a0 commit 4b63b0e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/nwp_consumer/internal/entities/modelmetadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def with_region(self, region: str) -> "ModelMetadata":
123123
)).unwrap()
124124
case "nl":
125125
return self.expected_coordinates.crop(
126-
north=53.8, west=2.8, south=50.6, east=7.7,
126+
north=54, west=2, south=50, east=8,
127127
).map(lambda coords: dataclasses.replace(
128128
self, name=f"{self.name}_nl", expected_coordinates=coords,
129129
)).unwrap()

src/nwp_consumer/internal/repositories/raw_repositories/ecmwf_realtime.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def repository() -> entities.RawRepositoryMetadata:
8787
"hres-ifs-india": entities.Models.ECMWF_HRES_IFS_0P1DEGREE.with_region("india")\
8888
.with_chunk_count_overrides({"variable": 1}),
8989
"hres-ifs-nl": entities.Models.ECMWF_HRES_IFS_0P1DEGREE.with_region("nl")\
90-
.with_max_step(56),
90+
.with_max_step(84),
9191
},
9292
)
9393

@@ -245,6 +245,7 @@ def _convert(path: pathlib.Path) -> ResultE[list[xr.DataArray]]:
245245
))
246246

247247
processed_das: list[xr.DataArray] = []
248+
num_skipped: int = 0
248249
expected_lons = ECMWFRealTimeS3RawRepository.model().expected_coordinates.longitude
249250
expected_lats = ECMWFRealTimeS3RawRepository.model().expected_coordinates.latitude
250251

@@ -259,6 +260,7 @@ def _convert(path: pathlib.Path) -> ResultE[list[xr.DataArray]]:
259260
(expected_lats[-1] <= max(ds.coords["latitude"].values) <= expected_lats[0])
260261
)
261262
if not is_relevant_dataset_predicate:
263+
num_skipped += 1
262264
continue
263265
try:
264266
da: xr.DataArray = (
@@ -301,10 +303,11 @@ def _convert(path: pathlib.Path) -> ResultE[list[xr.DataArray]]:
301303
)
302304

303305
if len(processed_das) == 0:
304-
return Failure(ValueError(
306+
# Some files do not have data for the relevant area, so don't error here
307+
log.warning(
305308
f"No DataArrays found in '{path}' after processing. "
306309
"Ensure the file contains the expected parameters.",
307-
))
310+
)
308311

309312
return Success(processed_das)
310313

0 commit comments

Comments
 (0)