Skip to content

Surprising error on lat and lon of a multilevel dataset. #68

@AliceBalfanz

Description

@AliceBalfanz

Describe the bug
When inspecting a multilevel dataset with xrlint, lat and lon get a surprising error message about the size of the dimension. But only starting with the 1 level. The base level does not show the error. Also when inspecting the levels directly themselves (e.g. 1.zarr) with xrlint, the error is not raised.

ds[0]                                            warn   Access latency exceeds threshold: 44.1 > 2.5 seconds.                      access-latency
ds[0]                                            warn   Missing attribute 'title'.                                                 content-desc
ds[0]                                            warn   Missing attribute 'history'.                                               content-desc
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'institution'.                                           content-desc
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'source'.                                                content-desc
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'references'.                                            content-desc
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'comment'.                                               content-desc
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'institution'.                                           content-desc
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'source'.                                                content-desc
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'references'.                                            content-desc
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'comment'.                                               content-desc
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'institution'.                                           content-desc
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'source'.                                                content-desc
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'references'.                                            content-desc
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'comment'.                                               content-desc
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'institution'.                                           content-desc
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'source'.                                                content-desc
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'references'.                                            content-desc
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'comment'.                                               content-desc
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'institution'.                                           content-desc
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'source'.                                                content-desc
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'references'.                                            content-desc
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'comment'.                                               content-desc
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'institution'.                                           content-desc
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'source'.                                                content-desc
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'references'.                                            content-desc
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'comment'.                                               content-desc
ds[0].data_vars['B2_mean'].attrs                 warn   Missing metadata, attributes are empty.                                    no-empty-attrs
ds[0].data_vars['B3_mean'].attrs                 warn   Missing metadata, attributes are empty.                                    no-empty-attrs
ds[0].data_vars['B4_mean'].attrs                 warn   Missing metadata, attributes are empty.                                    no-empty-attrs
ds[0].data_vars['SD_q1_mean'].attrs              warn   Missing metadata, attributes are empty.                                    no-empty-attrs
ds[0].data_vars['chl_q1_mean'].attrs             warn   Missing metadata, attributes are empty.                                    no-empty-attrs
ds[0].data_vars['tur_nechad_865_q1_mean'].attrs  warn   Missing metadata, attributes are empty.                                    no-empty-attrs
ds[0].coords['time']                             error  Missing timezone in encoding 'units': 'days since 1970-01-01'.             time-coordinate
ds[0].coords['time_bnds']                        error  Missing timezone in encoding 'units': 'days since 1970-01-01'.             time-coordinate
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'standard_name'.                                         var-desc
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'long_name'.                                             var-desc
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'standard_name'.                                         var-desc
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'long_name'.                                             var-desc
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'standard_name'.                                         var-desc
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'long_name'.                                             var-desc
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'standard_name'.                                         var-desc
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'long_name'.                                             var-desc
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'standard_name'.                                         var-desc
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'long_name'.                                             var-desc
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'standard_name'.                                         var-desc
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'long_name'.                                             var-desc
ds[0].coords['lat']                              warn   Unexpected encoding '_FillValue', coordinates must not have missing data.  var-missing-data
ds[0].coords['lat_bnds']                         warn   Unexpected encoding '_FillValue', coordinates must not have missing data.  var-missing-data
ds[0].coords['lon']                              warn   Unexpected encoding '_FillValue', coordinates must not have missing data.  var-missing-data
ds[0].coords['lon_bnds']                         warn   Unexpected encoding '_FillValue', coordinates must not have missing data.  var-missing-data
ds[0].coords['time']                             warn   Unexpected encoding '_FillValue', coordinates must not have missing data.  var-missing-data
ds[0].coords['time_bnds']                        warn   Unexpected encoding '_FillValue', coordinates must not have missing data.  var-missing-data
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'units'.                                                 var-units
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'units'.                                                 var-units
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'units'.                                                 var-units
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'units'.                                                 var-units
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'units'.                                                 var-units
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'units'.                                                 var-units
ds[0].data_vars['B2_mean']                       warn   Missing attribute 'color_bar_name'.                                        xcube/data-var-colors
ds[0].data_vars['B3_mean']                       warn   Missing attribute 'color_bar_name'.                                        xcube/data-var-colors
ds[0].data_vars['B4_mean']                       warn   Missing attribute 'color_bar_name'.                                        xcube/data-var-colors
ds[0].data_vars['SD_q1_mean']                    warn   Missing attribute 'color_bar_name'.                                        xcube/data-var-colors
ds[0].data_vars['chl_q1_mean']                   warn   Missing attribute 'color_bar_name'.                                        xcube/data-var-colors
ds[0].data_vars['tur_nechad_865_q1_mean']        warn   Missing attribute 'color_bar_name'.                                        xcube/data-var-colors
ds[0]                                            error  Missing attribute 'title'.                                                 xcube/dataset-title
ds[0]                                            error  Missing '.zlevels' meta-info file.                                         xcube/ml-dataset-meta
ds[0].coords['time']                             warn   Number of chunks exceeds limit: 1375 > 5.                                  xcube/no-chunked-coords

and then starting with the levels additionally these lines appear. Note that only the error for lat appears for level 1 and 2. From level 3 onwards the error also appears for lon.

ds[1]                                            error  Expected size of dimension 'lat' in level 1 to be 2479, but was 2480.      xcube/ml-dataset-xy

ds[2]                                            error  Expected size of dimension 'lat' in level 2 to be 1239, but was 1240.      xcube/ml-dataset-xy

ds[3]                                            error  Expected size of dimension 'lon' in level 3 to be 1203, but was 1204.      xcube/ml-dataset-xy
ds[3]                                            error  Expected size of dimension 'lat' in level 3 to be 619, but was 620.        xcube/ml-dataset-xy


ds[4]                                            error  Expected size of dimension 'lon' in level 4 to be 601, but was 602.        xcube/ml-dataset-xy
ds[4]                                            error  Expected size of dimension 'lat' in level 4 to be 309, but was 310.        xcube/ml-dataset-xy

ds[5]                                            error  Expected size of dimension 'lon' in level 5 to be 300, but was 301.        xcube/ml-dataset-xy
ds[5]                                            error  Expected size of dimension 'lat' in level 5 to be 154, but was 155.        xcube/ml-dataset-xy

We investigated the lon and lat values for this cube and cannot find any place from where the mismatch comes from. Internal cube, happy to provicde the location of it for testing.

Expected behavior
I would expect that the error does not occur.
Python Environment

  • operating system:
  • XRLint version, output of xrlint --version: 0.5.1
  • optional: packages and their versions, output of pip list or conda list:
    .

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions