Satip icon indicating copy to clipboard operation
Satip copied to clipboard

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

Open JackKelly opened this issue 3 years ago • 4 comments

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 :slightly_smiling_face:

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 (https://github.com/openclimatefix/nowcasting_dataset/issues/484), although it might be related (I'm not sure yet!)

JackKelly avatar Nov 23 '21 12:11 JackKelly

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.

jacobbieker avatar Nov 23 '21 12:11 jacobbieker

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 avatar Nov 23 '21 13:11 JackKelly

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

JackKelly avatar Nov 23 '21 20:11 JackKelly

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.

JackKelly avatar Nov 23 '21 20:11 JackKelly