Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot fix for multiple spatial coords #18

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading