;This example code illustrates how to access and visualize LP_DAAC_MOD Grid in NCL. ;If you have any questions, suggestions, comments on this example, please use the HDF-EOS Forum (http://hdfeos.org/forums). ;If you would like to see an example of any other NASA HDF/HDF-EOS data product that is not listed in the HDF-EOS Comprehensive Examples page (http://hdfeos.org/zoo), ;feel free to contact us at eoshelp@hdfgroup.org or post it at the HDF-EOS Forum (http://hdfeos.org/forums). load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" ; This is an example of a 3-D grid file data field at one specific level. ; It is assumed users know how to obtain information such as _FillValue from HDFView. ; For information about HDFView, visit http://www.hdfgroup.org/hdf-java-html/hdfview/. begin eos_file=addfile("MOD43B4.A2006353.h15v15.004.2007006030047.hdf.he2", "r") ; Read file. ;To read HDF-EOS2 files, .he2 is appended to the argument. ;For more information, consult section 4.3.2 of http://hdfeos.org/software/ncl.php. data_unscaled=eos_file->Nadir_Reflectance_MOD_Grid_BRDF ; read data field ; In order to read the Nadir_Reflectance data field from the HDF-EOS2 file, the group ; under which the data field is placed must be appended to the data field in NCL. For more information, ; visit section 4.3.2 of http://hdfeos.org/software/ncl.php. data_unscaled@_FillValue=32767h data=data_unscaled(:,:,5)*1.0E-4 data@lat2d=eos_file->GridLat_MOD_Grid_BRDF data@lon2d=eos_file->GridLon_MOD_Grid_BRDF xwks=gsn_open_wks("pdf","MOD_Grid_BRDF_Nadir_Reflectance_1lvl") ; open workstation res=True ; plot mods desired res@cnFillOn=True ; enable contour fill res@gsnMaximize=True; make plot large res@gsnPaperOrientation = "portrait" ; force portrait orientation res@cnLinesOn=False ; turn off contour lines res@cnLineLabelsOn = False; turn off contour line labels res@gsnSpreadColors=True ; use the entire color spectrum res@cnFillMode="RasterFill" ; faster res@lbOrientation="vertical" ;vertical labels res@cnMissingValFillPattern = 0 ; missing value pattern is set to "SolidFill" res@cnMissingValFillColor=0; white color for missing values res@mpLimitMode = "LatLon" res@mpMinLatF = min(data@lat2d) ; Set limits of map, based on the min/max of the dataset latitude/longitude res@mpMaxLatF = max(data@lat2d) ; res@mpMinLonF = min(data@lon2d) ; res@mpMaxLonF = max(data@lon2d) ; gsn_define_colormap(xwks,"BlAqGrYeOrReVi200") ; choose colormap res@tiMainString = "MOD43B4.A2006353.h15v15.004.2007006030047.hdf" ; create title res@gsnCenterString="Nadir_Reflectance" plot=gsn_csm_contour_map_ce(xwks,data,res) ; create plot delete(plot) ; cleaning up used resources delete(xwks) delete(data_unscaled) delete(data) delete(res) delete(eos_file) end