diff --git a/src/nwp_consumer/internal/inputs/noaa/ncar.py b/src/nwp_consumer/internal/inputs/noaa/ncar.py index 0a97bd80..f3655379 100644 --- a/src/nwp_consumer/internal/inputs/noaa/ncar.py +++ b/src/nwp_consumer/internal/inputs/noaa/ncar.py @@ -217,4 +217,6 @@ def parameterConformMap(self) -> dict[str, internal.OCFParameter]: "r": internal.OCFParameter.RelativeHumidityAGL, "u10_instant": internal.OCFParameter.WindUComponentAGL, "v10_instant": internal.OCFParameter.WindVComponentAGL, + "u100_instant": internal.OCFParameter.WindUComponent100m, + "v100_instant": internal.OCFParameter.WindVComponent100m, } diff --git a/src/nwp_consumer/internal/outputs/localfs/client.py b/src/nwp_consumer/internal/outputs/localfs/client.py index de9e311c..e4a4538e 100644 --- a/src/nwp_consumer/internal/outputs/localfs/client.py +++ b/src/nwp_consumer/internal/outputs/localfs/client.py @@ -32,25 +32,27 @@ def store(self, *, src: pathlib.Path, dst: pathlib.Path) -> pathlib.Path: return dst dst.parent.mkdir(parents=True, exist_ok=True) - # Delete the cache to avoid double storage - shutil.move(src=src, dst=dst) + shutil.copy(src=src, dst=dst) - nbytes = os.stat(dst).st_size - if nbytes != dst.stat().st_size: + if src.stat().st_size != dst.stat().st_size: log.warn( event="file size mismatch", src=src.as_posix(), dst=dst.as_posix(), srcbytes=src.stat().st_size, - dstbytes=nbytes, + dstbytes=dst.stat().st_size, ) else: log.debug( event="stored file locally", src=src.as_posix(), dst=dst.as_posix(), - nbytes=nbytes, + nbytes=dst.stat().st_size, ) + + # Delete the cache to avoid double storage + src.unlink() + return dst def listInitTimes(self, *, prefix: pathlib.Path) -> list[dt.datetime]: