Opened 11 years ago

Closed 11 years ago

#5044 closed enhancement (worksforme)

Recognize HDF scale/offset metadata

Reported by: simonf Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: HDF4
Cc: antonio

Description

For HDF files stored here: ftp://casfse.bu.edu/data20/sqs/gapfilled/2001/

gdalinfo prints the following HDF-level metadata:

Metadata:

HDFEOSVersion=HDFEOS_V2.17 _FillValue=32767 valid_range=1000, 0 scale_factor=0.001 add_offset=0 long_name=Gapfilled BRDF/Albedo data from MCD43D unit=none

If the field names 'scale_factor' and 'add_offset' are standard for HDF, gdal band-level functions GetScale and GetOffset() should return the corresponding values. Currently they return None. For comparison, the FillValue field is recognized by GDAL.

Change History (3)

comment:1 by antonio, 11 years ago

Cc: antonio added

comment:2 by warmerdam, 11 years ago

Component: defaultGDAL_Raster
Keywords: HDF4 added
Status: newassigned

comment:3 by warmerdam, 11 years ago

Resolution: worksforme
Status: assignedclosed

This is already working in GDAL trunk.

Driver: HDF4Image/HDF4 Dataset
Files: MCD43GF_bsa_Band1_065_2001.hdf
Size is 43200, 21600
Coordinate System is:
GEOGCS["Unknown datum based upon the Clarke 1866 ellipsoid",
    DATUM["Not specified (based on Clarke 1866 spheroid)",
        SPHEROID["Clarke 1866",6378206.4,294.9786982139006,
            AUTHORITY["EPSG","7008"]]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (-180.000000000000000,90.000000000000000)
Pixel Size = (0.008333333333333,-0.008333333333333)
Metadata:
  _FillValue=32767
  add_offset=0
  HDFEOSVersion=HDFEOS_V2.17
  long_name=Gapfilled BRDF/Albedo data from MCD43D
  scale_factor=0.001
  unit=none
  valid_range=1000, 0
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
Lower Left  (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
Upper Right ( 180.0000000,  90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
Center      (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)
Band 1 Block=43200x10 Type=Int16, ColorInterp=Gray
  Description = Gapfilled BRDF/Albedo data from MCD43D
  NoData Value=32767
  Offset: 0,   Scale:0.001

Please upgrade. :-)

Note: See TracTickets for help on using tickets.