Ticket #1900 (assigned defect)
Get hdf band, inverse data set dimensions
| Reported by: | cermak | Owned by: | dron |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | normal | Keywords: | hdf4 |
| Cc: | ilucena, dnadeau, dron |
Description (last modified by warmerdam) (diff)
Hi!
In the MODIS cloud product hdf files (MOD03, MYD03) some data sets are stored with the band dimension last instead of first.
gdalinfo myfile.hdf (or gdal.Dataset.GetSubDatasets) yields: [snip] SUBDATASET_52_NAME=HDF4_EOS:EOS_SWATH:'myfile.hdf':mod06:Cloud_Mask_1km SUBDATASET_52_DESC=[2040x1354x2] Cloud_Mask_1km mod06 (8-bit integer) [snip]
So obviously there are two bands of size 2040x1354 in the subdataset. However, in order for gdal to recognize them as two bands the dimensions would have to be [2x2040x1354].
Accordingly, when I do gdalinfo HDF4_EOS:EOS_SWATH:'myfile.hdf':mod06:Cloud_Mask_1km I get information on 2040 different bands, each of size 1354x2
It would be useful to have a feature in gdal that allows explicit selection of the dimension that holds the band count or even let gdal decide on this.
A sample file is at: ftp://ladsweb.nascom.nasa.gov/allData/5/MYD06_L2/2006/220/MYD06_L2.A2006220.1315.005.2006222153137.hdf
Thanks and all best, Jan
PS: hdfview can read these files.

