Demonstrates that ESA CCI Sea Surface Temperature (SST) L4 data is wrongly interpreted by xarray in two ways:
1947-05-12T09:58:14
instead of 2010-01-01T12:00:00
-50
to 600
Kelvin instead of 270
to 310
Kelvin.Test data: ftp://anon-ftp.ceda.ac.uk/neodc/esacci/sst/data/lt/Analysis/L4/v01.1/2010/01/01/20100101120000-ESACCI-L4_GHRSST-SSTdepth-OSTIA-GLOB_LT-v02.0-fv01.1.nc
In [16]:
%matplotlib inline
import xarray as xr
import xarray.plot as plot
file = '20100101120000-ESACCI-L4_GHRSST-SSTdepth-OSTIA-GLOB_LT-v02.0-fv01.1.nc'
ds = xr.open_dataset(file, decode_cf=False)
im = ds.analysed_sst.sel(time=slice(None, None))
# Remove attributes to make it easier to read output
ds.attrs = {}
im.attrs = {}
In [17]:
ds
Out[17]:
In [18]:
im
Out[18]:
In [19]:
im.min(), im.max()
Out[19]:
From the image below, we can see that the raw values seem to under or overflow (signed/unsigned short misinterpretation?)
In [20]:
plot.imshow(im.isel(time=0))
Out[20]:
In [21]:
im2 = im.clip(min=-300, max=4500)
In [22]:
plot.imshow(im2.isel(time=0))
Out[22]:
In [26]:
import netCDF4
import matplotlib.pyplot as plt
d = netCDF4.Dataset(file)
v = d['analysed_sst']
#v.set_auto_maskandscale(False)
plt.imshow(v[0, ...], origin='lower')
plt.show()
In [27]:
v = d['analysed_sst']
v.set_auto_maskandscale(False)
plt.imshow(v[0, ...], origin='lower')
plt.show()
In [ ]: