[ncl-talk] Reading GPM.DPR.V7 swath data and make Longitude_Vs_Height plot

Dipak Sahu dipakmath at gmail.com
Mon Jun 26 15:17:14 MDT 2017


Dear NCL users
        Here I was just tried to plot the Longitude_Vs_Height figure for
precipitation rate from the GPM DPR radar data sets
"2A.GPM.DPR.V7-20170308.20140706-S080134-E093406.002002.V05A.HDF5". This is
a HDF5 data format, and here the variables formats are like below:
Latitude[ 7934 <nscan> x 24 <nrayHS> ]
Longitude[ 7934 <nscan> x 24 <nrayHS> ]
precipRate[ 7934 <nscan> x 24 <nrayHS> x 88 <nbinHS> ]

I just success to plot the nscan_Vs_nbinHS for "precipRate". But, I am
wondering how to plot a Longitude_Vs_Height plot at any point within the
satellite swath? Your help is appreciated.

Here is my script Attached below:

****************************************************************
begin
;----------------------------------------------------------------------
; open file:specify desired variable
;----------------------------------------------------------------------
 dir = "../"
 f = addfile(dir+file_name, "r")

;----------------------------------------------------------------------
; Access variable in group  "/Grid" ; Note group access is via => syntax
;----------------------------------------------------------------------
    var_name = "precipRate"
    grp      = f=>/HS/SLV
    p        = grp->$var_name$

  delete(grp)

  printVarSummary(p)

  data = p
  grp = f=>/HS
  lat = grp->Latitude
  lon = grp->Longitude
  delete(grp)
   print("read lat/Lon")

  data at long_name = "precp_rate"
  data at _FillValue = -9999.0
  data at units = "mm/hr"

;--- Extract Lat Lon in 1D -----
   lat1d = ndtooned( lat )
   lon1d = ndtooned( lon )

  printVarSummary(lat)
  printVarSummary(lon)
  printVarSummary(lev)
  printVarSummary(data)


  dimx  = dimsizes(lat)
  nscan  = dimx(0)
  nscan  = dimx(0)
  nray  = dimx(1)

  do nlv = 0, nray-1
;----------------------------------------------------------------------
; create graphical resources
;----------------------------------------------------------------------
  wtype          = "png"
  wtype at wkWidth  = 1500     ; Set the pixel size of PNG image.
  wtype at wkHeight = 1500
  wks = gsn_open_wks(wtype, "gpmDPR-prcprate-LonHgt-"+nlv)

  gsn_define_colormap(wks,"perc2_9lev") ; select color map

  res=True
  res at gsnMaximize             = True   ;make plot large
  res at gsnPaperOrientation     = "portrait"    ;force portrait orientation
  res at gsnSpreadColors         = True    ; use the entire color spectrum
  res at cnFillOn                = True   ;enable contour fill
  res at cnLinesOn               = False   ;turn off contour line
  res at cnLineLabelsOn          = False    ;turn off contour line labels
  res at cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
  res at cnMinLevelValF   =  1 ;0.0               ; set min contour level
  res at cnMaxLevelValF   =  30               ; set max contour level
  res at cnLevelSpacingF  =  2              ; set contour spacing

  res at lbLabelAutoStride       = True
  res at lbOrientation           = "vertical" ;vertical labels

  res at tiMainString    = file_name
  res at tiXAxisString   = "nscan"
  res at tiYAxisString   = "nbin"
  res at gsnLeftStringFontHeightF  = 12 ; make font smaller
  res at gsnRightStringFontHeightF = 12 ; make font smaller

  res at trYReverse  = True    ; Flip the level axis

  plot = gsn_csm_contour(wks,data(nbinHS|:, nrayHS|nlv, nscan|:),res)

  end do

  delete(plot)
  delete(data)
  delete(res)

end

Thanks
Dipak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170626/621aab4f/attachment.html 


More information about the ncl-talk mailing list