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

Fix rectangle of zeros to the north east of the UK on eumetsat_*.zarr #30

Open
JackKelly opened this issue Nov 23, 2021 · 4 comments
Open
Labels
bug Something isn't working

Comments

@JackKelly
Copy link
Member

JackKelly commented Nov 23, 2021

Describe the bug
From manually looking at the "eumetsat_*.zarr" data (i.e. the non-HRV data), most timesteps have a rectangle of zeros like this:

image

Occasionally the rectangle extends further west:
image

Occasionally there is no rectangle:
image
image

The HRV data doesn't appear to have this "rectangle of zeros" problem.

In the non-HRV data: for a given timestep, the rectangle appears to be the same shape across all the non-HRV channels.

To Reproduce

ZARR_PATH = "/mnt/storage_ssd_8tb/data/ocf/solar_pv_nowcasting/nowcasting_dataset_pipeline/satellite/EUMETSAT/SEVIRI_RSS/zarr/v2/eumetsat_*.zarr"

ds_from_zarr = xr.open_mfdataset(
    ZARR_PATH, mode="r", engine="zarr", chunks='auto', parallel=True, concat_dim='time', combine='nested',
    preprocess=lambda dataset: dataset.drop_vars("acq_time", errors="ignore")
)

VARIABLE = "VIS006"
data = ds_from_zarr['stacked_eumetsat_data'].sel(variable=VARIABLE, time=pd.Timestamp("2020-07-01T12:00"))
data.plot.imshow(figsize=(10, 10), x='x', y='y');

Expected behavior
No rectangle of zeros 🙂

Additional context
For now, we can probably work around this issue:

  • The "rectangle of zeros" probably won't affect our training too much, because I would guess the "rectangle of zeros" is too far north to appear in most of our examples? (Although I don't remember how large of a satellite image we're currently using?)
  • We should maybe re-compute the means and standard deviations for the satellite data, ignoring the northern latitudes where the "rectangle of zeros" sometimes appears.
  • This doesn't appear to explain the -1 issue (-1s in the satellite data nowcasting_dataset#484), although it might be related (I'm not sure yet!)
@JackKelly JackKelly added the bug Something isn't working label Nov 23, 2021
@jacobbieker
Copy link
Member

Thanks for looking into this! The size of the satellite image is 24x24 with the 4-6km pixels for these Non-HRV channels, larger as we go further north, which then gives 144km on the largest ones. So these might show up on examples in the north I guess.

@JackKelly
Copy link
Member Author

OK, cool beans, I've started two new issues to work round this issue for now.

In terms of fixing this issue (which perhaps isn't super-urgent) I guess the next step is to figure out if these "rectangles of zeros" existing in the original .nat files

@JackKelly
Copy link
Member Author

The "rectangle of zeros" starts at 1,037,047 meters (OSGB "northing") and extends north.

@JackKelly JackKelly changed the title Rectangle of zeros to the north east of the UK on eumetsat_*.zarr Fix rectangle of zeros to the north east of the UK on eumetsat_*.zarr Nov 23, 2021
@JackKelly
Copy link
Member Author

OK, I've implemented the code to drop GSPs which are so far north that they might bump into the "rectangles of zeros"... luckily this only drops 2 GSPs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Todo
Development

No branches or pull requests

2 participants