Open forman opened 5 years ago
This issue is similar to #832, as the cause is a misinterpretation of lat/lon coordinate variables. The variables of AOD ENVISAT MERIS orbit frequency products are all 1D, so are lon/lat coord vars:
>>> ds = xr.open_dataset("~/.cate/data_stores/local/local.esacci.AEROSOL.satellite-orbit-frequency.L2P.AOD.MERIS.Envisat.MERIS_ENVISAT.2-2.r1.85c9886a-d2d5-32dc-9fb6-030dd198a7c8/20080101071710-ESACCI-L2P_AEROSOL-AOD-MERIS_ENVISAT-ALAMO-fv2.2.nc")
>>> ds.coords
Coordinates:
* pixel_number (pixel_number) float64 0.0 1.0 2.0 ... 1.426e+04 1.426e+04
latitude (pixel_number) float32 ...
longitude (pixel_number) float32 ...
>>> ds.data_vars
Data variables:
iline (pixel_number) float64 ...
icolumn (pixel_number) float64 ...
pixel_corner_latitude1 (pixel_number) float32 ...
pixel_corner_latitude2 (pixel_number) float32 ...
pixel_corner_latitude3 (pixel_number) float32 ...
pixel_corner_latitude4 (pixel_number) float32 ...
pixel_corner_longitude1 (pixel_number) float32 ...
pixel_corner_longitude2 (pixel_number) float32 ...
pixel_corner_longitude3 (pixel_number) float32 ...
pixel_corner_longitude4 (pixel_number) float32 ...
AOD550 (pixel_number) float32 ...
AOD550_std (pixel_number) float32 ...
AOD865 (pixel_number) float32 ...
AOD865_std (pixel_number) float32 ...
fAOD550 (pixel_number) float32 ...
fAOD550_std (pixel_number) float32 ...
fAOD865 (pixel_number) float32 ...
fAOD865_std (pixel_number) float32 ...
R_eff (pixel_number) float32 ...
R_eff_std (pixel_number) float32 ...
Aerosol_Altitude (pixel_number) float32 ...
Aerosol_Altitude_std (pixel_number) float32 ...
The error occurs in Cate while opening multiple files in xr.open_mfdataset()
. To stack multiple AOD orbit frequency products along time dimension, we must also stack the 'lon' and 'lat' variables. This could be done by moving them from coordinate variables into the data variables of an xarray dataset. The criterion for lon/lat being real coordinates to be excluded from stacking is that their dimension names are lon
and lat
too: lon(lon)
and lat(lat)
. In the case AOD orbit frequency products it is instead longitude(pixel_number)
and latitude(pixel_number)
.
For time being a solution could be to display a better error message, e.g. "Unable to concatenate time steps, because their coordinate variables are not equal."
Expected behavior
Dataset downloads should produce consitent time series.
Actual behavior
Stacking the downloaded dataset files for AOD ENVISAT MERIS orbit frequency (see related #835) along time dimension should always be possible, because their spatial grids are expected to be aligned.
Steps to reproduce the problem
Please follow steps as described in #835.
If the download does not time-out, it ends with an operation error "variable latitude not equal across datasets".
Specifications
Cate 2.0.0.dev25
Traceback