Re: MODIS HDF

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 30 2011 - 11:44:39 MDT

Mike

[1]
%> ncl_filedump MOD17A3.A2010365.h00v08.305.2011029145245.hdf

yields

Variable: f
Type: file
filename: MOD17A3.A2010365.h00v08.305.2011029145245
path: MOD17A3.A2010365.h00v08.305.2011029145245.hdf
    file global attributes:
       HDFEOSVersion : HDFEOS_V2.16
       StructMetadata_0 : GROUP=SwathStructure
END_GROUP=SwathStructure
GROUP=GridStructure
         GROUP=GRID_1
                 GridName="MOD_Grid_MOD17A3"
                 XDim=1200
                 YDim=1200
                 UpperLeftPointMtrs=(-20015109.354000,1111950.519667)
                 LowerRightMtrs=(-18903158.834333,0.000000)
                 Projection=GCTP_SNSOID
[SNIP]

[2]
If you append the '.hdfeos' suffix, you will get that lat/lon values.

%> ncl_filedump MOD17A3.A2010365.h00v08.305.2011029145245.hdf.hdfeos

Variable: f
Type: file
filename: MOD17A3.A2010365.h00v08.305.2011029145245.hdf
path: MOD17A3.A2010365.h00v08.305.2011029145245.hdf
    file global attributes:
    dimensions:
       YDim_MOD_Grid_MOD17A3 = 1200
       XDim_MOD_Grid_MOD17A3 = 1200
    variables:
       double GridLat_MOD_Grid_MOD17A3 ( YDim_MOD_Grid_MOD17A3,
XDim_MOD_Grid_MOD17A3 )
          projection : (null)
          corners : ( 9.995833332438675, 9.995833332438675,
0.004166666666293064, 0.004166666666293064 )
          long_name : latitude
          units : degrees_north

       double GridLon_MOD_Grid_MOD17A3 ( YDim_MOD_Grid_MOD17A3,
XDim_MOD_Grid_MOD17A3 )
          projection : (null)
          corners : ( 177.2297839752788, -172.6245418649626,
-170.00416710093, -179.9958337931229 )
          long_name : longitude
          units : degrees_east
[snip]

[3] Use the hdfeos suffix. The names are different than using 'just' hdf
however NCL does provide the georeferenced data coordinates.

[4] You might look at:

http://www.ncl.ucar.edu/Applications/binning.shtml

Good luck
D

On 8/30/11 11:23 AM, Michael Notaro wrote:
> I am trying to work with MODIS HDF data of the land variable 1-km annual NPP (net primary productivity).
>
> ftp://ftp.ntsg.umt.edu/pub/MODIS/Mirror/MOD17_Science_2010/MOD17A3/
>
> Each file is on a separate tile. I put the info below on a sample file's
> info on the variable Npp_1km and the 1200x1200 grid and bounding rectangle.
>
> It is my understanding that I should grab the rectangles that overlap my study region,
> which is Wisconsin. I think 4 of them overlap it.
>
> I can read in the data with addfile (or use ncl_convert2nc). But I am not sure
> how to retrieve the proper lats/lons to plot the data correctly. I used short2flt also
> when reading it. I am guessing that the data grid must not be a normal rectangle but
> stretched as the satellite moves, since the range of the lats is 10 degrees but the
> range of the lons is 60 degrees.
>
> Any suggestions on how to plot this in NCL is appreciated.
>
> Michael
>
>
> YDim_MOD_Grid_MOD17A3 = 1200 ;
> XDim_MOD_Grid_MOD17A3 = 1200 ;
>
> short Npp_1km(YDim_MOD_Grid_MOD17A3, XDim_MOD_Grid_MOD17A3) ;
> Npp_1km:hdf_name = "Npp_1km" ;
> Npp_1km:units = "kg_C/m^2" ;
> Npp_1km:long_name = "MOD17A3 NPP--MODIS Gridded 1KM Annual Net Primary Productivity (NPP)" ;
> Npp_1km:_FillValue = -1s ;
> Npp_1km:valid_range = 0s, -36s ;
> Npp_1km:calibrated_nt = 23 ;
> Npp_1km:add_offset_err = 0. ;
> Npp_1km:add_offset = 0. ;
> Npp_1km:scale_factor_err = 0. ;
> Npp_1km:scale_factor = 0.0001 ;
>
> " OBJECT = NORTHBOUNDINGCOORDINATE\n",
> " NUM_VAL = 1\n",
> " VALUE = 69.9999999937138\n",
> " END_OBJECT = NORTHBOUNDINGCOORDINATE\n",
> "\n",
> " OBJECT = SOUTHBOUNDINGCOORDINATE\n",
> " NUM_VAL = 1\n",
> " VALUE = 59.9999999946118\n",
> " END_OBJECT = SOUTHBOUNDINGCOORDINATE\n",
> "\n",
> " OBJECT = EASTBOUNDINGCOORDINATE\n",
> " NUM_VAL = 1\n",
> " VALUE = -119.983333303015\n",
> " END_OBJECT = EASTBOUNDINGCOORDINATE\n",
> "\n",
> " OBJECT = WESTBOUNDINGCOORDINATE\n",
> " NUM_VAL = 1\n",
> " VALUE = -179.999999938971\n",
> " END_OBJECT = WESTBOUNDINGCOORDINATE\n",
> "\n",
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 30 11:44:47 2011

This archive was generated by hypermail 2.1.8 : Wed Sep 07 2011 - 10:58:58 MDT