Ticket #2581 (assigned enhancement)

Opened 3 years ago

Last modified 14 months ago

netcdf: add metadata record for original array dimension when reading from multidimensional files

Reported by: mdsumner Owned by: kyle
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: netcdf
Cc: neteler, dnadeau, kyle

Description

When accessing a file with 3D or 4D subdatasets such as NetCDF it's possible to discover the original array dimension via the "DESC=[TxZxYxX]" tag.

This information is not available for single dataset files - there is no analogous "DESC=[dim]" tag for multi-dim arrays from single dataset files.

The higher dimensions get unrolled into bands but there's no record of the original shape - having this metadata available as per SDS files would be useful.

An example file from the Unidata samples:  http://www.unidata.ucar.edu/software/netcdf/examples/rhum.2003.nc

This file contains variable "rhum"(time=365, level=8, lat=73, lon=144) that is unrolled to a 2920 band raster.

Attachments

foo.nc Download (4.0 KB) - added by mdsumner 3 years ago.
single 3D variable netCDF file

Change History

Changed 3 years ago by mdsumner

single 3D variable netCDF file

Changed 3 years ago by mdsumner

Attached a more convenient file "foo.nc":

This contains a single 5x2x2 raster ([2x2x5] by NC convention) that unrolls to 2 bands:

Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute Driver: netCDF/Network Common Data Format Files: foo.nc Size is 5, 2 Coordinate System is `' Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 2.0) Upper Right ( 5.0, 0.0) Lower Right ( 5.0, 2.0) Center ( 2.5, 1.0) Band 1 Block=5x1 Type=Float64, ColorInterp?=Undefined

NoData? Value=9.969209968386869e+036 Metadata:

NETCDF_VARNAME=temperature NETCDF_DIMENSION_x=1

Band 2 Block=5x1 Type=Float64, ColorInterp?=Undefined

NoData? Value=9.969209968386869e+036 Metadata:

NETCDF_VARNAME=temperature NETCDF_DIMENSION_x=2

Changed 3 years ago by neteler

  • cc neteler added

Changed 3 years ago by warmerdam

  • cc dnadeau added

Changed 3 years ago by rouault

  • keywords netcdf added
  • component changed from default to GDAL_Raster
  • summary changed from add metadata record for original array dimension when reading from multidimensional files to netcdf: add metadata record for original array dimension when reading from multidimensional files

Changed 15 months ago by kyle

  • cc kyle added

Changed 14 months ago by kyle

Would a metadata item such as:

someVariable#original_dimensions="time=365, level=8, lat=73, lon=144"

or something along that line? As in a file level metadata item identifying variables and the associated dimensions. Sorry, I just found this ticket a couple of weeks ago.

Changed 14 months ago by kyle

  • owner changed from warmerdam to kyle
  • status changed from new to assigned
Note: See TracTickets for help on using tickets.