diff --git a/pvnet_app/app.py b/pvnet_app/app.py index 5d707f3..10fc4bf 100644 --- a/pvnet_app/app.py +++ b/pvnet_app/app.py @@ -286,8 +286,20 @@ def app( # Download nwp data logger.info("Downloading nwp data") fs = fsspec.open(os.environ["NWP_ZARR_PATH"]).fs - fs.get(os.environ["NWP_ZARR_PATH"], "nwp.zarr", recursive=True) - + fs.get(os.environ["NWP_ZARR_PATH"], "nwp.zarr", recursive=True) + + ################ + # Hot fix as datapipes can't handle both lat-lon and osgb on same coord + ds_nwp = xr.open_zarr("nwp.zarr").compute() + if "latitude" in ds_nwp: + ds_nwp = ds_nwp.drop_vars(("latitude", "longitude")) + ds_nwp["variable"] = ds_nwp.variable.astype(str) + os.system("rm -r nwp.zarr") + ds_nwp.to_zarr("nwp.zarr") + + del ds_nwp + ################ + # --------------------------------------------------------------------------- # 2. Set up data loader logger.info("Creating DataLoader")