[ncl-talk] Issue with vector scalar plot

Trisanu Banik baniktrisanu at gmail.com
Sat Mar 14 06:35:47 MDT 2020


Hi

Please find the attached plot and code.

The problem, I am facing is clearly noticeable in the plot. I tried to turn
off the contour label in the X and Y axes of the plot but unable to do the
same. Please suggest me how to rectify the issue.

Thnaks & Regards
Trisanu Banik

*Trisanu Banik,PhD*

*Scientist/Engineer-'SC'*

*North Eastern Space Applications Centre (NESAC)*
*Department of Space*
*Government of India*

*Umiam-793103, Meghalaya*
*Mobile-9774837581*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200314/42082fa6/attachment-0001.html>
-------------- next part --------------
 f1       = addfile ("wrfout_d01_2018-07-21_I","r")
  rainc_1   = f1->RAINC                 ; (Time, south_north, west_east)
  rainnc_1  = f1->RAINNC
  u10_1     = f1->U10                   ; (Time, south_north, west_east)
  v10_1     = f1->V10
  XLAT     = f1->XLAT
  XLONG    = f1->XLONG

  times_1   = wrf_user_getvar(f1,"times",-1)
  ntim_1    = dimsizes(times_1)          ; # time steps



  rainc_1   = rainc_1  > 0.0
  rainnc_1  = rainnc_1 > 0.0
  rainTot_1 = rainc_1 + rainnc_1
  ;rainTot_1 at description = "Total Precipitation_ISRO"
  ;rainTot_1 at units       =  rainc_1 at units

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  f2       = addfile ("wrfout_d01_2018-07-21_M","r")
  rainc_2   = f2->RAINC                 ; (Time, south_north, west_east)
  rainnc_2  = f2->RAINNC
  u10_2     = f2->U10                   ; (Time, south_north, west_east)
  v10_2     = f2->V10

  times_2   = wrf_user_getvar(f2,"times",-1)
  ntim_2    = dimsizes(times_2)          ; # time steps

;
; Use NCL operator > to make sure all values >=0.0
; Sum components and assign attributes
;
  rainc_2   = rainc_2  > 0.0
  rainnc_2  = rainnc_2 > 0.0
  rainTot_2 = rainc_2 + rainnc_2
  ;rainTot_2 at description = "Total Precipitation MODIS"
  ;rainTot_2 at units       =  rainc_2 at units
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  f3       = addfile ("wrfout_d01_2018-07-21_U","r")
  rainc_3   = f3->RAINC                 ; (Time, south_north, west_east)
  rainnc_3   = f3->RAINNC
  u10_3      = f3->U10                   ; (Time, south_north, west_east)
  v10_3      = f3->V10

  times_3   = wrf_user_getvar(f3,"times",-1)
  ntim_3    = dimsizes(times_3)          ; # time steps

;
; Use NCL operator > to make sure all values >=0.0
; Sum components and assign attributes
;
  rainc_3   = rainc_3  > 0.0
  rainnc_3  = rainnc_3 > 0.0
  rainTot_3 = rainc_3 + rainnc_3
  ;rainTot_3 at description = "Total Precipitation USGS"
  ;rainTot_3 at units       =  rainc_3 at units


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
wks = gsn_open_wks("png","WRF_prc&wind_d01_new")

  colors = (/"white","azure"          \
            ,"green","palegreen","yellowgreen", "greenyellow" \
            ,"yellow","goldenrod","orange","orangered"        \
            ,"red","deeppinK", "violet","darkviolet"          \
            ,"blueviolet","blue"                              /)

 ; cmap = read_colormap_file("gui_default")
  res_lit                   =  True
  res_lit at gsnMaximize           = True
 ; res at mpProjection          = "Mercator"
  res_lit at gsnDraw               = False
  res_lit at gsnFrame                 = False
  res_lit at gsnScalarContour      = True               ; contours desired
  res_lit at cnInfoLabelOn       = False

  res_lit at gsnLeftString         = "Wind Vectors (m/s)"
  res_lit at gsnRightString        = "Total Precipitation (mm)"
  res_lit at cnFillOn              = True            ; color plot desired

  res_lit at cnFillMode           = "RasterFill"
  res_lit at cnFillPalette        = colors


  res_lit at cnLineLabelsOn       = False            ; do not use line labels res at cnFillPalette         = colors           ; define colors for contour plot
  res_lit at cnLinesOn             = False            ; turn off contour lines
  res_lit at cnLineLabelsOn        = False            ; turn off contour labels
 ; res at tmYROn                   = False
  res_lit at cnLineLabelsOn           = False
 ; res at cnFillMode            = "RasterFill"     ; raster
 ;  res_lit at cnLevelSelectionMode = "ManualLevels"
; res_lit at cnMinLevelValF  = 0
; res_lit at cnMaxLevelValF  = 200
; res_lit at cnLevelSpacingF = 5.
; res at cnFrame = False




  res_lit at vcMinFracLengthF = 1.0 ;-- length of min vector as
 ;-- fraction of reference vector
 res_lit at vcRefMagnitudeF = 3.0
  res_lit at vcGlyphStyle          = "WindBarb"
  res_lit at vcRefLengthF          = 0.025            ; ref vec length
  res_lit at vcMinDistanceF        = 0.025            ; larger means sparser
  res_lit at vcWindBarbTickLengthF = 0.4              ; default 0.3

 ; res at vcRefAnnoOn           = False
 ; res at tmYROn       = False
 ;  res at tmYLOn       = True
 ; res at tmXTOn       = False
 ; res at tmXBOn       = True


  res_lit = wrf_map_resources(f1,res_lit)
 ; res at gsnAddCyclic          = False            ; regional data: not cyclic
  res_lit at tfDoNDCOverlay        = True

  res_lit at mpFillOn                    = False
  res_lit at mpGeophysicalLineColor      = "black"    ; wrf_map_resources uses "gray"
 ; res at mpUSStateLineColor          = "black"
 res_lit at mpGeophysicalLineThicknessF = 3.0        ; wrf_map_resources uses 0.5
 ; res at mpUSStateLineThicknessF     = 3.0
 ; res at tmXBLabelFontHeightF        = 0.018
 ; res at tmYLLabelFontHeightF        = 0.018


;---Allocate array for plots
  plts = new (3 , "graphic")                   ; 1d array to hold plots

  res_lit at gsnDraw               = False            ; (a) do not draw
  res_lit at gsnFrame              = False            ; (b) do not advance 'frame'
  res_lit at lbLabelBarOn          = False            ; (c) turn off individual lb's
;  nt = 0
;;do nt=0,ntim-1                               ; uncomment to loop



;---Create panel: panel plots have their own set of resources
  resP                      = True             ; modify the panel plot
  resP at gsnMaximize          = True             ; maximize panel area
  resP at gsnPanelRowSpec      = True             ; specify 1 top, 2 lower level
  resP at gsnPanelLabelBar     = True             ; add common colorbar
  resP at pmLabelBarWidthF     = 0.85             ; make label wider
  resP at lbLabelFontHeightF   = 0.015            ; default 0.02 [demo make smaller]
  resP at gsnPanelMainString   = " Wind and Precipitation Plot (21/07/2018)"
  resP at gsnPanelFigureStrings = (/"a)ISRO","b)MODIS","c)USGS"/)   ; add strings to panel
  resP at gsnPanelFigureStringsFontHeightF = 0.015    ; make figure strings slightly bigger
  resP at lbBoxEndCapStyle = "TriangleBothEnds"


;  resP at gsnPanelLabelsOn       = False            ; do not use line labels
;  resP at cnLineLabelsOn       = False            ; do not use line labels res at cnFillPalette         = colors           ; define colors for contour plot
;  resP at cnLinesOn             = False            ; turn off contour lines
;  resP at cnLineLabelsOn        = False            ; turn off contour labels




  nt = 0
 do nt=0,ntim_1-1                               ; uncomment to loop


    ; res at tiMainString             = times_1(0)
     plts(0) = gsn_csm_vector_scalar_map(wks,u10_1(nt,:,:),v10_1(nt,:,:),rainTot_1(nt,:,:),res_lit)
     plts(1) = gsn_csm_vector_scalar_map(wks,u10_2(nt,:,:),v10_2(nt,:,:),rainTot_2(nt,:,:),res_lit)
     plts(2) = gsn_csm_vector_scalar_map(wks,u10_3(nt,:,:),v10_3(nt,:,:),rainTot_3(nt,:,:),res_lit)



end do

gsn_panel(wks,plts,(/1,2/),resP)               ; now draw as one plot


-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF_prc&wind_d01_new.png
Type: image/png
Size: 368003 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200314/42082fa6/attachment-0001.png>


More information about the ncl-talk mailing list