[gdal-dev] 4D netcdf-CF file with pressure as elevation

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sun Nov 26 09:36:50 PST 2017


This came up here: https://github.com/r-spatial/stars/issues/12

We have a CF-1.4 conformant netcdf file found here:
https://drive.google.com/open?id=1QtmsU5OKegOcoVi00qnxozbbHr8DqA4U

which has some 4-dimensional arrays with time and vertical pressure
level coordinates. When reading this through the gdal netcdf driver, we see:

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

which suggests to me that the kz dimension coordinates (elevation by
pressure level) per band, as well as their list of values are wrong, and
were copied from the time values.

I noted from the ncdump that the file has a time(time) variable with the
time values, but not a kz(kz) variable; instead it has a sigma(kz)
variable with pressure values which vary between 0 and 1.

Is this known behaviour?
-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081


More information about the gdal-dev mailing list