Skip to content

Commit

Permalink
Merge pull request #18 from openclimatefix/hot_fix/multiple_spatial_c…
Browse files Browse the repository at this point in the history
…oords

hot fix for multiple spatial coords
  • Loading branch information
dfulu authored Oct 25, 2023
2 parents da41084 + a3d4efb commit a6c3019
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pvnet_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a6c3019

Please sign in to comment.