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

temp bug fix #10

Merged
merged 1 commit into from
Sep 19, 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 @@ -264,7 +264,7 @@ def app(
# Set up ID location query object
gsp_id_to_loc = GSPLocationLookup(ds_gsp.x_osgb, ds_gsp.y_osgb)

# Download satellite data - can't load zipped zarr straight from s3 bucket
# Download satellite data
logger.info("Downloading zipped satellite data")
fs = fsspec.open(os.environ["SATELLITE_ZARR_PATH"]).fs
fs.get(os.environ["SATELLITE_ZARR_PATH"], "sat.zarr.zip")
Expand All @@ -275,10 +275,22 @@ def app(
logger.info("Downloading 15-minute satellite data")
fs.get(sat_latest_15, "sat_15.zarr.zip")

# Download nwp data - can't load zipped zarr straight from s3 bucket
# 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
ds = xr.open_zarr("nwp.zarr").compute()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add logger.warning

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")
########


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