Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#7165 closed defect (fixed)

NetCDF driver gives wrong dimension values if they are given under a different name

Reported by: edzer Owned by: warmerdam
Priority: normal Milestone: 2.2.4
Component: default Version: 2.1.2
Severity: normal Keywords:
Cc:

Description (last modified by edzer)

See: https://lists.osgeo.org/pipermail/gdal-dev/2017-November/047800.html

A NetCDF file with dimension kz does not have a corresponding variable kz but another, sigma(kz) with pressure values. The GDAL NetCDF driver gives wrongly the values of another value (time), and a wrong length value array.

Some evidence:

gdalinfo NETCDF:"CORDEXRUN_4_RAD.1990010100.nc":cl | head -170 | tail -7

NETCDF_DIM_EXTRA={time,kz} NETCDF_DIM_kz_DEF={18,6}

NETCDF_DIM_kz_VALUES={351390,351396,351402,351408,351414,351420,351426,351432,351438,351444,351450,351456,351462,351468,351474,351480,351486,351492,351498,351504,351510,351516,351522,351528,351534,351540,351546,351552,351558,351564,351570,351576,351582,351588,351594,351600,351606,351612,351618,351624,351630,351636,351642,351648,351654,351660,351666,351672,351678,351684,351690,351696,351702,351708,351714,351720,351726,351732,351738,351744,351750,351756,351762,351768,351774,351780,351786,351792,351798,351804,351810,351816,351822,351828,351834,351840,351846,351852,351858,351864,351870,351876,351882,351888,351894,351900,351906,351912,351918,351924,351930,351936,351942,351948,351954,351960,351966,351972,351978,351984,351990,351996,352002,352008,352014,352020,352026,352032,352038,352044,352050,352056,352062,352068,352074,352080,352086,352092,352098,352104} NETCDF_DIM_time_DEF={120,6}

NETCDF_DIM_time_VALUES={351390,351396,351402,351408,351414,351420,351426,351432,351438,351444,351450,351456,351462,351468,351474,351480,351486,351492,351498,351504,351510,351516,351522,351528,351534,351540,351546,351552,351558,351564,351570,351576,351582,351588,351594,351600,351606,351612,351618,351624,351630,351636,351642,351648,351654,351660,351666,351672,351678,351684,351690,351696,351702,351708,351714,351720,351726,351732,351738,351744,351750,351756,351762,351768,351774,351780,351786,351792,351798,351804,351810,351816,351822,351828,351834,351840,351846,351852,351858,351864,351870,351876,351882,351888,351894,351900,351906,351912,351918,351924,351930,351936,351942,351948,351954,351960,351966,351972,351978,351984,351990,351996,352002,352008,352014,352020,352026,352032,352038,352044,352050,352056,352062,352068,352074,352080,352086,352092,352098,352104} time#bounds=time_bnds time#calendar=gregorian

and the last band has metainfo:

Band 2160 Block=65x1 Type=Float32, ColorInterp?=Undefined

NoData? Value=9.96920996838686905e+36 Unit Type: 1 Metadata:

cell_methods=time: point coordinates=xlat xlon grid_mapping=crs long_name=Cloud fractional cover NETCDF_DIM_Kz=351492 NETCDF_DIM_time=352104 NETCDF_VARNAME=cl standard_name=cloud_area_fraction_in_atmosphere_layer units=1

where Kz values should vary between 0 and 1.

Change History (5)

comment:1 Changed 10 months ago by edzer

Description: modified (diff)

comment:2 Changed 10 months ago by edzer

The example file is too large to upload here; it can be downloaded from http://pebesma.staff.ifgi.de/CORDEXRUN_4_RAD.1990010100.nc

comment:3 Changed 10 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40852:

netCDF: behave correctly when an extra dimension of a variable has a corresponding 1D variable of different names (fixes #7165)

comment:4 Changed 10 months ago by Even Rouault

In 40853:

netCDF: behave correctly when an extra dimension of a variable has a corresponding 1D variable of different names (fixes #7165)

comment:5 Changed 10 months ago by Even Rouault

Milestone: 2.2.4
Note: See TracTickets for help on using tickets.