google-research / weatherbench2

A benchmark for the next generation of data-driven global weather models.
https://weatherbench2.readthedocs.io
Apache License 2.0
407 stars 41 forks source link

ERA5 IFS ensemble mean containing nans? #88

Closed stratisMarkou closed 7 months ago

stratisMarkou commented 9 months ago

Does the ERA5 IFS ensemble mean contain nans? This might just be incorrect usage on my side, but consider this example:

import numpy as np
import xarray as xr

# Set locations for IFS ensemble and IFS ensemble mean
IFS_ENS = "gs://weatherbench2/datasets/ens/2018-240x121_equiangular_with_poles_conservative.zarr" 
IFS_ENS_MEAN = "gs://weatherbench2/datasets/ens/2018-240x121_equiangular_with_poles_conservative_mean.zarr" 

# Load IFS ENS arrays
ifs_ens_array = xr.open_zarr(IFS_ENS)
ifs_ens_mean_array = xr.open_zarr(IFS_ENS_MEAN)

The IFS ensemble array seems okay, but the IFS ensemble mean array seems to contain nans:

# Running this returns `False`
np.isnan(ifs_ens_array["2m_temperature"][0, :, :, :, :].values).any()

# returns
# False

# but running this
ifs_ens_mean_array["2m_temperature"][0, 0, :, :].values

# returns
# array([[nan, nan, nan, ..., nan, nan, nan],
#        [nan, nan, nan, ..., nan, nan, nan],
#        [nan, nan, nan, ..., nan, nan, nan],
#        ...,
#        [nan, nan, nan, ..., nan, nan, nan],
#        [nan, nan, nan, ..., nan, nan, nan],
#        [nan, nan, nan, ..., nan, nan, nan]], dtype=float32)
chloepilonv commented 9 months ago

I obtain the same results - and "True" when I run np.isnan(ifs_ens_mean_array["2m_temperature"][0, 0, :, :].values).any().

chloepilonv commented 9 months ago

I ran other "mean" files, from other years and different resolution, and this one seems like the only one with "NaN" (but I might be wrong!).

raspstephan commented 9 months ago

Hi, thanks for pointing this out. I made a mistake computing the 2018 ensemble means. I am in the process of updating the ensemble files (they might not be available for a day or two). After that, the corrected 2018-2022 ensemble files will be online. I will close this issue once the upload is done. Thanks for your patience.