TransWikia.com

Different pixel value between gdalwarp and ENVI classic in MODIS

Geographic Information Systems Asked by mega saputra on April 20, 2021

I succeed running gdalwarp in level 1 MODIS data. The data in : https://1drv.ms/u/s!AjXAWS5maHffhxx_Pf2j2snnXocs?e=ceHHcd

When I run gdalinfo, the partial information is like this :

$ gdalinfo a1.20315.0552.1000m.hdf

SUBDATASET_1_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_1KM_RefSB
SUBDATASET_1_DESC=[15x4280x1354] EV_1KM_RefSB MODIS_SWATH_Type_L1B (16-bit unsigned integer)
SUBDATASET_2_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_1KM_RefSB_Uncert_Indexes
SUBDATASET_2_DESC=[15x4280x1354] EV_1KM_RefSB_Uncert_Indexes MODIS_SWATH_Type_L1B (8-bit unsigned integer)
SUBDATASET_3_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_1KM_Emissive
SUBDATASET_3_DESC=[16x4280x1354] EV_1KM_Emissive MODIS_SWATH_Type_L1B (16-bit unsigned integer)
SUBDATASET_4_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_1KM_Emissive_Uncert_Indexes
SUBDATASET_4_DESC=[16x4280x1354] EV_1KM_Emissive_Uncert_Indexes MODIS_SWATH_Type_L1B (8-bit unsigned integer)
SUBDATASET_5_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_250_Aggr1km_RefSB
SUBDATASET_5_DESC=[2x4280x1354] EV_250_Aggr1km_RefSB MODIS_SWATH_Type_L1B (16-bit unsigned integer)
SUBDATASET_6_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_250_Aggr1km_RefSB_Uncert_Indexes
SUBDATASET_6_DESC=[2x4280x1354] EV_250_Aggr1km_RefSB_Uncert_Indexes MODIS_SWATH_Type_L1B (8-bit unsigned integer)
SUBDATASET_7_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_250_Aggr1km_RefSB_Samples_Used
SUBDATASET_7_DESC=[2x4280x1354] EV_250_Aggr1km_RefSB_Samples_Used MODIS_SWATH_Type_L1B (8-bit integer)
SUBDATASET_8_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_500_Aggr1km_RefSB
SUBDATASET_8_DESC=[5x4280x1354] EV_500_Aggr1km_RefSB MODIS_SWATH_Type_L1B (16-bit unsigned integer)
SUBDATASET_9_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_500_Aggr1km_RefSB_Uncert_Indexes
SUBDATASET_9_DESC=[5x4280x1354] EV_500_Aggr1km_RefSB_Uncert_Indexes MODIS_SWATH_Type_L1B (8-bit unsigned integer)
SUBDATASET_10_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_500_Aggr1km_RefSB_Samples_Used
SUBDATASET_10_DESC=[5x4280x1354] EV_500_Aggr1km_RefSB_Samples_Used MODIS_SWATH_Type_L1B (8-bit integer)
SUBDATASET_11_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:Height
SUBDATASET_11_DESC=[856x271] Height MODIS_SWATH_Type_L1B (16-bit integer)
SUBDATASET_12_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:SensorZenith
SUBDATASET_12_DESC=[856x271] SensorZenith MODIS_SWATH_Type_L1B (16-bit integer)
SUBDATASET_13_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:SensorAzimuth
SUBDATASET_13_DESC=[856x271] SensorAzimuth MODIS_SWATH_Type_L1B (16-bit integer)
SUBDATASET_14_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:Range
SUBDATASET_14_DESC=[856x271] Range MODIS_SWATH_Type_L1B (16-bit unsigned integer)
SUBDATASET_15_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:SolarZenith
SUBDATASET_15_DESC=[856x271] SolarZenith MODIS_SWATH_Type_L1B (16-bit integer)
SUBDATASET_16_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:SolarAzimuth
SUBDATASET_16_DESC=[856x271] SolarAzimuth MODIS_SWATH_Type_L1B (16-bit integer)
SUBDATASET_17_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:gflags
SUBDATASET_17_DESC=[856x271] gflags MODIS_SWATH_Type_L1B (8-bit unsigned integer)
SUBDATASET_18_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_Band26
SUBDATASET_18_DESC=[4280x1354] EV_Band26 MODIS_SWATH_Type_L1B (16-bit unsigned integer)
SUBDATASET_19_NAME=HDF4_EOS:EOS_SWATH:"a1.20315.0552.1000m.hdf":MODIS_SWATH_Type_L1B:EV_Band26_Uncert_Indexes
SUBDATASET_19_DESC=[4280x1354] EV_Band26_Uncert_Indexes MODIS_SWATH_Type_L1B (8-bit unsigned integer)
SUBDATASET_20_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":0
SUBDATASET_20_DESC=[856x271] Latitude (32-bit floating-point)
SUBDATASET_21_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":1
SUBDATASET_21_DESC=[856x271] Longitude (32-bit floating-point)
SUBDATASET_22_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":2
SUBDATASET_22_DESC=[15x4280x1354] EV_1KM_RefSB (16-bit unsigned integer)
SUBDATASET_23_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":3
SUBDATASET_23_DESC=[15x4280x1354] EV_1KM_RefSB_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_24_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":4
SUBDATASET_24_DESC=[16x4280x1354] EV_1KM_Emissive (16-bit unsigned integer)
SUBDATASET_25_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":5
SUBDATASET_25_DESC=[16x4280x1354] EV_1KM_Emissive_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_26_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":6
SUBDATASET_26_DESC=[2x4280x1354] EV_250_Aggr1km_RefSB (16-bit unsigned integer)
SUBDATASET_27_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":7
SUBDATASET_27_DESC=[2x4280x1354] EV_250_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_28_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":8
SUBDATASET_28_DESC=[2x4280x1354] EV_250_Aggr1km_RefSB_Samples_Used (8-bit integer)
SUBDATASET_29_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":9
SUBDATASET_29_DESC=[5x4280x1354] EV_500_Aggr1km_RefSB (16-bit unsigned integer)
SUBDATASET_30_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":10
SUBDATASET_30_DESC=[5x4280x1354] EV_500_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_31_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":11
SUBDATASET_31_DESC=[5x4280x1354] EV_500_Aggr1km_RefSB_Samples_Used (8-bit integer)
SUBDATASET_32_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":12
SUBDATASET_32_DESC=[856x271] Height (16-bit integer)
SUBDATASET_33_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":13
SUBDATASET_33_DESC=[856x271] SensorZenith (16-bit integer)
SUBDATASET_34_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":14
SUBDATASET_34_DESC=[856x271] SensorAzimuth (16-bit integer)
SUBDATASET_35_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":15
SUBDATASET_35_DESC=[856x271] Range (16-bit unsigned integer)
SUBDATASET_36_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":16
SUBDATASET_36_DESC=[856x271] SolarZenith (16-bit integer)
SUBDATASET_37_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":17
SUBDATASET_37_DESC=[856x271] SolarAzimuth (16-bit integer)
SUBDATASET_38_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":18
SUBDATASET_38_DESC=[856x271] gflags (8-bit unsigned integer)
SUBDATASET_39_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":19
SUBDATASET_39_DESC=[4280x1354] EV_Band26 (16-bit unsigned integer)
SUBDATASET_40_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":20
SUBDATASET_40_DESC=[4280x1354] EV_Band26_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_41_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":25
SUBDATASET_41_DESC=[16x10] Noise in Thermal Detectors (8-bit unsigned integer)
SUBDATASET_42_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":26
SUBDATASET_42_DESC=[16x10] Change in relative responses of thermal detectors (8-bit unsigned integer)
SUBDATASET_43_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":27
SUBDATASET_43_DESC=[428x16x10] DC Restore Change for Thermal Bands (8-bit integer)
SUBDATASET_44_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":28
SUBDATASET_44_DESC=[428x2x40] DC Restore Change for Reflective 250m Bands (8-bit integer)
SUBDATASET_45_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":29
SUBDATASET_45_DESC=[428x5x20] DC Restore Change for Reflective 500m Bands (8-bit integer)
SUBDATASET_46_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":30
SUBDATASET_46_DESC=[428x15x10] DC Restore Change for Reflective 1km Bands (8-bit integer)

I want to extract band 3 until band 7 "1KM Reflectance 500M Aggr". I am not sure where I find these band. From ENVI Classic, I can find these band. But from gdalinfo, I just guess the subdataset is "SUBDATASET_29_NAME=HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":9". Correct me if I am wrong. Then I run gdalwarp :

$ gdalwarp -t_srs EPSG:4326 HDF4_SDS:UNKNOWN:"a1.20315.0552.1000m.hdf":9 refl.tif

Creating output file that is 2968P x 3988L.
Processing input file HDF4_SDS:UNKNOWN:a1.20315.0552.1000m.hdf:9.
0...10...20..Warning 1: Metadata exceeding 32000 bytes cannot be written into GeoTIFF. Transferred to PAM instead.
.30...40...50...60...70...80...90...100 - done.

I open the result in QGIS. The pixel value is not decimal (about ten thousand). The pixel value is different when I georeference using ENVI Classic. The pixel value is decimal. I think the correct value for reflectance is using ENVI Classic.
So, do I skip the step using gdal?

One Answer

Finally I get the answer. With gdalinfo, I know that the file need to multiply with reflectance scale. The partial information from gdalinfo is here :

$ gdalinfo refl.tif

reflectance_offsets=-0, -0, -0, -0, -0
reflectance_scales=4.494304449e-05, 3.147337338e-05, 3.348880273e-05, 3.483542241e-05, 2.825953925e-05
reflectance_units=none

When I compare, the result is not far from ENVI Classic.

Answered by mega saputra on April 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP