; ; This example code illustrates how to access and visualize GESDISC GPM ; L3 HDF5 file 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). ; Usage:save this script and run ; ; $ncl 3A-MO.GPM.GMI.GRID2017R1.20140701-S000000-E235959.07.V05A.HDF5.ncl ; ; Tested under: NCL 6.4.0 ; Last updated: 2018-01-29 load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ; This is the main program. begin file_name = "3A-MO.GPM.GMI.GRID2017R1.20140701-S000000-E235959.07.V05A.HDF5" ; Read file as an HDF5 file. h5_file = addfile(file_name, "r") ; print(h5_file) g = h5_file=>/Grid data_raw = g->cloudWater(0,:,:) data = transpose(data_raw) data@long_name = "/Grid/cloudWater" data@units = data_raw@units data@_FillValue = data_raw@_FillValue lon=ispan(0,1440-1,1)*0.25 - 180 + 0.125 lat=ispan(0,720-1,1)*0.25 - 90 + 0.125 lat@units = "degrees_north" lon@units = "degrees_east" data&nlat = lat data&nlon= lon wks = gsn_open_wks("png", file_name+".ncl") ; open workstation res=True res@gsnMaximize=True ;make plot large res@gsnPaperOrientation = "portrait" ;force portrait orientation res@gsnSpreadColors=True ; use the entire color spectrum res@cnFillOn=True ;enable contour fill res@cnLinesOn=False ;turn off contour line res@cnLineLabelsOn = False ;turn off contour line labels res@cnFillMode="RasterFill" ;faster res@lbLabelAutoStride= True res@lbOrientation="vertical" ;vertical labels res@trGridType = "TriangularMesh" res@tiMainString = file_name res@gsnLeftStringFontHeightF = 12 ; make font smaller res@gsnRightStringFontHeightF = 12 ; make font smaller plot=gsn_csm_contour_map(wks,data,res) delete(plot) delete(data) delete(res) delete(h5_file) end