Skip to content

Commit

Permalink
Merge pull request #13 from openclimatefix/remove_nwp_flip
Browse files Browse the repository at this point in the history
Remove NWP y-axis flip
  • Loading branch information
dfulu authored Sep 25, 2023
2 parents 2446cf0 + 8caf2d7 commit 9a48924
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions pvnet_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,20 +278,7 @@ 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)

########
# TO DO: THIS IS A TEMPORARY BUG FIX TO COMPENSATE FOR A BUG IN THE NWP CONSUMER FLIPPING THE
# Y-AXIS IN THE NWP
logger.warning("Reassigning the y-axis coordinates to compensate for consumer bug")
ds = xr.open_zarr("nwp.zarr").compute()
os.system("rm -r nwp.zarr")
ds["y"] = ds["y"].values[::-1]
ds = ds.reindex(y=ds.y.values[::-1])
ds["variable"] = ds.variable.astype(str)
ds.to_zarr("nwp.zarr")
########

fs.get(os.environ["NWP_ZARR_PATH"], "nwp.zarr", recursive=True)

# ---------------------------------------------------------------------------
# 2. Set up data loader
Expand Down

0 comments on commit 9a48924

Please sign in to comment.