[gdal-dev] MODIS Cloud Mask reprojection

Stefan Keller sfkeller at gmail.com
Wed Apr 24 13:00:34 PDT 2013


Hi Rudger

I have a similar problem like Laure in the former thread "MODIS
reprojection".
I'd like to process the most recent, high resolution and free cloud data of
middle Europe.
=> I think it's MODIS Terra and Acqua, right?

Below you see the result of rhe metadata of my input file.
How can I convert this to say EPSG:3857 (Mercator/Google)?
When I try gdalwarp and gdal_translate the resulting image is distorted and
shifted.
=> Do I need to preprocess this swath first using MRT Swath?

Yours, Stefan


$ gdalinfo -nogcp HDF4_EOS:EOS_SWATH:"modis.hdf":mod35:Cloud_Mask
Driver: HDF4Image/HDF4 Dataset
Files: test1.hdf
Size is 1354, 2030
Coordinate System is `'
Metadata:
  _FillValue=0
  add_offset=0
  ALGORITHMPACKAGEACCEPTANCEDATE=June 1997
  ALGORITHMPACKAGEMATURITYCODE=at-launch
  ALGORITHMPACKAGENAME=ATBD-MOD-06
  ALGORITHMPACKAGEVERSION=2
  ANCILLARYINPUTPOINTER=MOD03.A2013112.1055.005.2013112115237.NRT.hdf
  ANCILLARYINPUTTYPE=Geolocation
  ASSOCIATEDINSTRUMENTSHORTNAME=MODIS
  ASSOCIATEDPLATFORMSHORTNAME=Terra
  ASSOCIATEDSENSORSHORTNAME=MODIS
  AUTOMATICQUALITYFLAG=Passed
  AUTOMATICQUALITYFLAGEXPLANATION=Passed if useable, Failed if not useable
  Cell_Across_Swath_Sampling=1, 1354, 1
  Cell_Along_Swath_Sampling=1, 2030, 1
  ClearPct250m=   33.62
  CLOUD_MASK_ALGORITHM_VERSION_NUMBER=    1.00
  CloudCoverPct250m=   66.38
  DAYNIGHTFLAG=Day
  DayProcessedPct=  100.00
  description=




 Bit fields within each byte are numbered from the left:

 7, 6, 5, 4, 3, 2, 1, 0.

 The left-most bit (bit 7) is the most significant bit.

 The right-most bit (bit 0) is the least significant bit.



 bit field       Description                             Key

 ---------       -----------                             ---



 0               Cloud Mask Flag                      0 = Not  determined

                                                      1 = Determined



 2, 1            Unobstructed FOV Quality Flag        00 = Cloudy

                                                      01 = Uncertain

                                                      10 = Probably  Clear

                                                      11 = Confident  Clear

                 PROCESSING PATH

                 ---------------

 3               Day or Night Path                    0 = Night  / 1 = Day

 4               Sunglint Path                        0 = Yes    / 1 = No

 5               Snow/Ice Background Path             0 = Yes    / 1 = No

 7, 6            Land or Water Path                   00 = Water

                                                      01 = Coastal

                                                      10 = Desert

                                                      11 = Land

 ____ END BYTE 1 ______________ ___________________________________________



 bit field       Description                             Key

 ---------       -----------                             ---



                 ADDITIONAL INFORMATION

                 ----------------------

 0               Non- cloud obstruction Flag              0 = Yes / 1 = No

 1               Thin Cirrus Detected  (Solar)           0 =  Yes / 1 = No

 2               Shadow Found                            0 =  Yes / 1 = No

 3               Thin Cirrus Detected  (Infrared)        0 =  Yes / 1 = No

 4               Adjacent Cloud Detected **              0 =  Yes / 1 = No

                 ** Implemented Post Launch to

                    Indicate cloud found within

                    surrounding 1 km pixels *



                 1-km CLOUD FLAGS

                 ----------------

 5               Cloud Flag -  IR Threshold               0 = Yes / 1 = No

 6               High Cloud Flag -  CO2 Test              0 = Yes / 1 = No

 7               High Cloud Flag -  6.7 micron Test       0 = Yes / 1 = No

 ____ END BYTE 2 ______________ ___________________________________________



 bit field       Description                             Key

 ---------       -----------                             ---



 0               High Cloud Flag -  1.38 micron Test      0 = Yes / 1 = No

 1               High Cloud Flag - 3.7- 12 micron Test    0 = Yes / 1 = No

 2               Cloud Flag -  IR Temperature             0 = Yes / 1 = No

                              Difference

 3               Cloud Flag - 3.7- 11 micron Test         0 = Yes / 1 = No

 4               Cloud Flag -  Visible Reflectance Test   0 = Yes / 1 = No

 5               Cloud Flag -  Visible Reflectance        0 = Yes / 1 = No

                              Ratio Test

 6               Cloud Flag -  NDVI Final Confidence      0 = Yes / 1 = No

                              Confirmation Test

 7               Cloud Flag - Night 7.3- 11 micron Test   0 = Yes / 1 = No

 ____ END BYTE 3 ______________ ___________________________________________



 bit field       Description                             Key

 ---------       -----------                             ---



                 ADDITIONAL TESTS

                 ----------------

 0               Cloud Flag -  Spare                      0 = Yes / 1 = No

 1               Cloud Flag -  Spatial Variability        0 = Yes / 1 = No

 2               Final Confidence Confirmation Test      0 =  Yes / 1 = No

 3               Cloud Flag -  Night Water                0 = Yes / 1 = No

                              Spatial Variability

 4               Suspended Dust Flag                     0 =  Yes / 1 = No



 5-7             Spares

 ____ END BYTE 4 ______________ ___________________________________________



 bit field       Description                             Key

 ---------       -----------                             ---



                 250-m Cloud Flag - Visible Tests

                 --------------------------------

 0               Element(1,1)                            0 =  Yes / 1 = No

 1               Element(1,2)                            0 =  Yes / 1 = No

 2               Element(1,3)                            0 =  Yes / 1 = No

 3               Element(1,4)                            0 =  Yes / 1 = No

 4               Element(2,1)                            0 =  Yes / 1 = No

 5               Element(2,2)                            0 =  Yes / 1 = No

 6               Element(2,3)                            0 =  Yes / 1 = No

 7               Element(2,4)                            0 =  Yes / 1 = No

 ____ END BYTE 5 ______________ ___________________________________________



 bit field       Description                             Key

 ----------      -----------                             ---



 0               Element(3,1)                            0 =  Yes / 1 = No

 1               Element(3,2)                            0 =  Yes / 1 = No

 2               Element(3,3)                            0 =  Yes / 1 = No

 3               Element(3,4)                            0 =  Yes / 1 = No

 4               Element(4,1)                            0 =  Yes / 1 = No

 5               Element(4,2)                            0 =  Yes / 1 = No

 6               Element(4,3)                            0 =  Yes / 1 = No

 7               Element(4,4)                            0 =  Yes / 1 = No

 ____ END BYTE 6 ______________ ___________________________________________


  DESCRREVISION=5.0
  EASTBOUNDINGCOORDINATE=27.983792228394
  EQUATORCROSSINGDATE=2013-04-22
  EQUATORCROSSINGLONGITUDE=-10.5355310197622
  EQUATORCROSSINGTIME=11:12:10.638063
  EXCLUSIONGRINGFLAG=N
  Geolocation_Pointer=External MODIS geolocation product
  GRINGPOINTLATITUDE=63.2076139095873, 57.1960273665282, 41.0114451068176,
44.9126646972378
  GRINGPOINTLONGITUDE=-14.1048478023953, 27.9851830412684,
14.6542811157768, -14.2028294853094
  GRINGPOINTSEQUENCENO=1, 2, 3, 4
  HDFEOSVersion=HDFEOS_V2.9
  HighConfidentClearPct=    2.09
  history=$Id: MOD35.V2.CDL,v 1.1.2.5 2002/09/16 18:24:50 raf Exp $


  INPUTPOINTER=MOD03.A2013112.1055.005.2013112115237.NRT.hdf,
MOD021KM.A2013112.1055.005.2013112115616.NRT.hdf,
MOD02QKM.A2013112.1055.005.2013112115616.NRT.hdf, goge1_2_img.v1,
ecosystem.img.v1, thresholds.dat.terra.v13, gfs.t06.130422.pgrbf06,
oisst.20130417, eng.130421, NISE_SSMISF17_20130421.HDFEOS,
destripe_config_terra.dat.v2
  INSTRUMENTNAME=Moderate Resolution Imaging Spectroradiometer
  LandProcessedPct=   56.56
  LOCALGRANULEID=MOD35_L2.A2013112.1055.005.2013112115902.NRT.hdf
  LOCALINPUTGRANULEID=MOD03.A2013112.1055.005.2013112115237.NRT.hdf,
MOD021KM.A2013112.1055.005.2013112115616.NRT.hdf,
MOD02QKM.A2013112.1055.005.2013112115616.NRT.hdf, goge1_2_img.v1,
ecosystem.img.v1, thresholds.dat.terra.v13, gfs.t06.130422.pgrbf06,
oisst.20130417, eng.130421, NISE_SSMISF17_20130421.HDFEOS
  LOCALVERSIONID=005
  long_name=MODIS Cloud Mask and Spectral Test Results
  LONGNAME=MODIS/Terra Cloud Mask and Spectral Test Results 5-Min L2 Swath
250m and 1km
  LowConfidentClearPct=   71.01
  Maximum_Number_of_1km_Frames=1354
  MaxSolarZenithAngle=   54.95
  MinSolarZenithAngle=   28.82
  NightProcessedPct=    0.00
  NonCloudObstructionFoundPct=    0.64
  NORTHBOUNDINGCOORDINATE=63.2313776766876
  Number_of_Instrument_Scans=2030
  ORBITNUMBER=70979
  Parameter_Type=Output
  PARAMETERNAME=Cloud_Mask
  PGEVERSION=PGE03:5.3.11
  PROCESSINGENVIRONMENT=Linux nrt1min104 2.6.18-238.19.1.el5PAE #1 SMP Fri
Jul 15 08:15:44 EDT 2011 i686 i686 i386 GNU/Linux
  PRODUCTIONDATETIME=2013-04-22T11:59:02.000Z
  PRODUCTIONHISTORY=PGE03:5.3.11
  QAPERCENTMISSINGDATA=0
  RANGEBEGINNINGDATE=2013-04-22
  RANGEBEGINNINGTIME=10:55:00.000000
  RANGEENDINGDATE=2013-04-22
  RANGEENDINGTIME=11:00:00.000000
  RCS_Id= $Id: thresholds.dat.terra.v13,v 1.1 2005/02/22 22:05:40 gumley
Exp $
  REPROCESSINGACTUAL=Near Real Time
  REPROCESSINGPLANNED=further update is anticipated
  scale_factor=1
  SCIENCEQUALITYFLAG=Not Investigated
  SCIENCEQUALITYFLAGEXPLANATION=See
http://modis-atmos.gsfc.nasa.gov/validation.html for more details on MODIS
Atmosphere data quality.
  ShadowFoundPct=    0.03
  SHORTNAME=MOD35_L2
  Snow_IceSurfaceProcessedPct=    0.16
  SOUTHBOUNDINGCOORDINATE=41.1487274178468
  SuccessfulRetrievalPct=  100.00
  SunglintProcessedPct=   13.53
  ThinCirrusIR_FoundPct=    6.77
  ThinCirrusSolarFoundPct=   27.58
  title=MODIS Level 2 Cloud Mask


  UncertainConfidentClearPct=    2.96
  units=none
  UW_DESTRIPE_CONFIG=# Terra MODIS destriping configuration $Id:
destripe_config_terra.dat.v2,v 1.2 2007/12/20 gumley Exp $
  UW_DESTRIPE_LWIR=$Id: hdf_destripe_new.f90,v 1.8 2004/06/24 14:25:27
gumley Exp $
  valid_range=0, 255
  VERSIONID=5
  VeryHighConfidentClearPct=   23.94
  WaterProcessedPct=   43.44
  WESTBOUNDINGCOORDINATE=-14.2008628227747
Geolocation:
  LINE_OFFSET=2
  LINE_STEP=5
  PIXEL_OFFSET=2
  PIXEL_STEP=5
  X_BAND=1
  X_DATASET=HDF4_EOS:EOS_SWATH_GEOL:"test1.hdf":mod35:Longitude
  Y_BAND=1
  Y_DATASET=HDF4_EOS:EOS_SWATH_GEOL:"test1.hdf":mod35:Latitude
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 2030.0)
Upper Right ( 1354.0,    0.0)
Lower Right ( 1354.0, 2030.0)
Center      (  677.0, 1015.0)
Band 1 Block=1354x738 Type=Byte, ColorInterp=Gray
  Description = MODIS Cloud Mask and Spectral Test Results
  NoData Value=0
  Unit Type: none
Band 2 Block=1354x738 Type=Byte, ColorInterp=Gray
  Description = MODIS Cloud Mask and Spectral Test Results
  NoData Value=0
  Unit Type: none
Band 3 Block=1354x738 Type=Byte, ColorInterp=Gray
  Description = MODIS Cloud Mask and Spectral Test Results
  NoData Value=0
  Unit Type: none
Band 4 Block=1354x738 Type=Byte, ColorInterp=Gray
  Description = MODIS Cloud Mask and Spectral Test Results
  NoData Value=0
  Unit Type: none
Band 5 Block=1354x738 Type=Byte, ColorInterp=Gray
  Description = MODIS Cloud Mask and Spectral Test Results
  NoData Value=0
  Unit Type: none
Band 6 Block=1354x738 Type=Byte, ColorInterp=Gray
  Description = MODIS Cloud Mask and Spectral Test Results
  NoData Value=0
  Unit Type: none
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130424/ed2deb89/attachment-0001.html>


More information about the gdal-dev mailing list