[ncl-talk] Overlay Wind plot issues.

Mary Haley haley at ucar.edu
Thu Jan 19 09:43:18 MST 2017


You can simply change the value after you create the first plot. Right now
you have:


;define plots
  plot = new( 10, graphic)

  ;make plots
  res at gsnLeftString           = "NCEP Wind"
  plot(0)   = gsn_csm_contour_map_overlay(wks,uwnd,uwnd,res,sres)   ;
create the temperature plot

  res at gsnLeftString           = "ERA-INT Wind"
  plot(1)   = gsn_csm_contour_map_overlay(wks,ua,ua,res,sres)

  res at gsnLeftString           = "CCCMA Wind"
  plot(2)   = gsn_csm_contour_map_overlay(wks,ua1,ua1,res,sres)
   . . .

So right before you create plot(0), set the resource to True:

  ;make plots
  res at gsnLeftString           = "NCEP Wind"
  res at gsnAddCyclic            = True
  plot(0)   = gsn_csm_contour_map_overlay(wks,uwnd,uwnd,res,sres)   ;
create the temperature plot

and then before you create the rest of the plots. set it to False.  It will
then stay equal to False for the rest of the code:

  res at gsnLeftString           = "ERA-INT Wind"
  res at gsnAddCyclic            = False
  plot(1)   = gsn_csm_contour_map_overlay(wks,ua,ua,res,sres)


On Thu, Jan 19, 2017 at 8:40 AM, Kwesi Quagraine <starskykwesi at gmail.com>
wrote:

> Thanks Mary, any idea how I can set res at gsnAddCyclic to False for only
> that plot? since the res is defined for all the other plots in my script?
>
> Thanks in advance.
>
> On Thu, Jan 19, 2017 at 5:37 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> Dear Kwesi,
>>
>> Your uwnd data is global (goes from 0 to 357.5), but it doesn't quite go
>> all the way to to 360, so you need to set res at gsnAddCyclic to True for
>> that data so the longitude cyclic point gets added.
>>
>> For the other plots, which appear to all be regional, set res at gsnAddCyclic
>> to False.
>>
>> --Mary
>>
>>
>> On Thu, Jan 19, 2017 at 3:27 AM, Kwesi Quagraine <starskykwesi at gmail.com>
>> wrote:
>>
>>> Hello NCLers, I am trying to make a wind overlay plot. I have been able
>>> to make the plot from the overlay template.
>>>
>>> [1] first plot in panel seem to only appear with some empty line through
>>> it when gsnAddCyclic = False (please see attached) whereas vice-versa
>>> distorts the other plots.
>>>
>>> [2] Also I want to increase the font size of the contour labels.
>>>
>>>  Any help will be much appreciated.
>>>
>>> Kwesi.
>>>
>>> Here's my script;
>>>
>>> begin
>>>    fili    = "700_ncepJULY.nc"
>>>    a       = addfile (diri+fili , "r")
>>>    uwnd = a->uwnd(0,0,:,:)
>>>    printVarSummary(uwnd)
>>>
>>>    fili    = "700_eraJULY.nc"
>>>    b       = addfile (diri+fili , "r")
>>>    ua = b->ua(0,0,:,:)
>>>
>>>    fili    = "700_ccmaJULY.nc"
>>>    c       = addfile (diri+fili , "r")
>>>    ua1 = c->ua(0,0,:,:)
>>>    printVarSummary(ua1)
>>>
>>>
>>>    fili    = "700_cnrmJULY.nc"
>>>    d       = addfile (diri+fili , "r")
>>>    ua2 = d->ua(0,0,:,:)
>>>
>>>    fili    = "700_ichecJULY.nc"
>>>    e       = addfile (diri+fili , "r")
>>>    ua3 = e->ua(0,0,:,:)
>>>
>>>    fili    = "700_ipslJULY.nc"
>>>    f       = addfile (diri+fili , "r")
>>>    ua4 = f->ua(0,0,:,:)
>>>
>>>    fili    = "700_mirocJULY.nc"
>>>    g       = addfile (diri+fili , "r")
>>>    ua5 = g->ua(0,0,:,:)
>>>
>>>    fili    = "700_mohcJULY.nc"
>>>    h       = addfile (diri+fili , "r")
>>>    ua6 = h->ua(0,0,:,:)
>>>
>>>    fili    = "700_mpiJULY.nc"
>>>    i       = addfile (diri+fili , "r")
>>>    ua7 = i->ua(0,0,:,:)
>>>
>>>    fili    = "700_nccJULY.nc"
>>>    j       = addfile (diri+fili , "r")
>>>    ua8 = j->ua(0,0,:,:)
>>>
>>>   wks = gsn_open_wks("pdf","julyuwnd at 700hPa")         ; send graphics
>>> to PNG file
>>>
>>>
>>>   ;set resources
>>>   res = True
>>>   res at mpFillOn     = False
>>>   res at mpMaxLatF    = 25.                      ; specify the plot domain
>>>   res at mpMinLatF    = 0.                      ;
>>>   res at mpMinLonF    = -20.                     ;
>>>   res at mpMaxLonF    = 20.                     ;
>>>   res at mpOutlineOn  = True                  ; turn the map outline on
>>>   res at gsnDraw      =  False                   ; do not draw the plot
>>>   res at gsnFrame     =  False                   ; do not advance the frame
>>>   res at gsnAddCyclic      =False
>>>   res at pmTickMarkDisplayMode = "Always"    ; nicer tickmarks
>>>   res at mpCenterLonF         = 0.                ; Centers the plot at
>>> 180
>>>
>>>
>>>   res at cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels
>>>   res at cnLevels             = ispan(-16,4,2) ; set the contour levels
>>>   res at cnLineLabelsOn       = True            ; do not use line labels
>>>   res at cnFillOn             = True             ; color fill
>>>   res at cnLinesOn            = True            ; do not draw contour lines
>>>   res at cnFillPalette        = "MPL_RdYlBu"
>>>   res at cnInfoLabelOn        = False              ; turn off contour info
>>> label
>>>   ;res at cnFillDrawOrder  = "Predraw"
>>>   res at lbLabelBarOn         = False              ; No single label bar
>>>
>>>   sres                      = True              ; set up a second
>>> resource list
>>>   sres at cnLevelSelectionMode = "ExplicitLevels"  ; use explicit levels
>>>   sres at cnLevels             = ispan(-16,4,2)   ; set the contour levels
>>>   sres at gsnAddCyclic          = False
>>>   sres at pmTickMarkDisplayMode = "Always"    ; nicer tickmarks
>>>   sres at cnInfoLabelOn        = False              ; turn off contour
>>> info label
>>>   sres at tiXAxisOn = False
>>>   sres at tiYAxisOn = False
>>>   sres at tiMainOn  = False
>>>
>>>
>>>   ;define plots
>>>   plot = new( 10, graphic)
>>>
>>>   ;make plots
>>>   res at gsnLeftString           = "NCEP Wind"
>>>   plot(0)   = gsn_csm_contour_map_overlay(wks,uwnd,uwnd,res,sres)   ;
>>> create the temperature plot
>>>
>>>   res at gsnLeftString           = "ERA-INT Wind"
>>>   plot(1)   = gsn_csm_contour_map_overlay(wks,ua,ua,res,sres)
>>>
>>>   res at gsnLeftString           = "CCCMA Wind"
>>>   plot(2)   = gsn_csm_contour_map_overlay(wks,ua1,ua1,res,sres)
>>>
>>>   res at gsnLeftString           = "CNRM Wind"
>>>   plot(3)   = gsn_csm_contour_map_overlay(wks,ua2,ua2,res,sres)
>>>
>>>   res at gsnLeftString           = "ICHEC Wind"
>>>   plot(4)   = gsn_csm_contour_map_overlay(wks,ua3,ua3,res,sres)
>>>
>>>   res at gsnLeftString           = "IPSL Wind"
>>>   plot(5)   = gsn_csm_contour_map_overlay(wks,ua4,ua4,res,sres)
>>>
>>>   res at gsnLeftString           = "MIROC Wind"
>>>   plot(6)   = gsn_csm_contour_map_overlay(wks,ua5,ua5,res,sres)
>>>
>>>   res at gsnLeftString           = "MOHC Wind"
>>>   plot(7)   = gsn_csm_contour_map_overlay(wks,ua6,ua6,res,sres)
>>>
>>>   res at gsnLeftString           = "MPI Wind"
>>>   plot(8)   = gsn_csm_contour_map_overlay(wks,ua7,ua7,res,sres)
>>>
>>>   res at gsnLeftString           = "NCC-NOR Wind"
>>>   plot(9)   = gsn_csm_contour_map_overlay(wks,ua8,ua8,res,sres)
>>>
>>>   resP                     = True               ; panel options
>>>   resP at gsnMaximize         = True               ; maximize image
>>>   resP at gsnPanelLabelBar    = True               ; Add common label bar
>>>   resP at txString            = "AEJ July"
>>> gsn_panel(wks,plot,(/5,2/),resP)
>>> end
>>>
>>>
>>> ​var summary;
>>> ​Variable: uwnd
>>> Type: float
>>> Total Size: 42048 bytes
>>>             10512 values
>>> Number of Dimensions: 2
>>> Dimensions and sizes:    [lat | 73] x [lon | 144]
>>> Coordinates:
>>>             lat: [90..-90]
>>>             lon: [ 0..357.5]
>>> Number Of Attributes: 14
>>>   level :     700
>>>   time :    1678608
>>>   long_name :    Monthly mean u wind
>>>   units :    m/s
>>>   _FillValue :    -9.96921e+36
>>>   missing_value :    -9.96921e+36
>>>   precision :    2
>>>   least_significant_digit :    1
>>>   var_desc :    u-wind
>>>   level_desc :    Multiple levels
>>>   statistic :    Mean
>>>   parent_stat :    Other
>>>   dataset :    NCEP Reanalysis Derived Products
>>>   actual_range :    ( -68.19482, 124.4 )
>>>
>>> Variable: ua1 (same for the rest)
>>> Type: float
>>> Total Size: 964004 bytes
>>>             241001 values
>>> Number of Dimensions: 2
>>> Dimensions and sizes:    [lat | 401] x [lon | 601]
>>> Coordinates:
>>>             lat: [ -15..  25]
>>>             lon: [ -30..  30]
>>> Number Of Attributes: 8
>>>   plev :    70000
>>>   time :    15192.5
>>>   standard_name :    eastward_wind
>>>   long_name :    Eastward Wind
>>>   units :    m s-1
>>>   _FillValue :    1e+20
>>>   missing_value :    1e+20
>>>   cell_methods :    time: mean
>>>
>>>
>>> --
>>> Try not to become a man of success but rather a man of value-Albert
>>> Einstein
>>>
>>> University of Cape Coast|College of Agriculture and Natural Sciences|Department
>>> of Physics|
>>> Team Leader|Recycle Up! Ghana|Technology Without Borders|
>>> Other emails: kwesi.quagraine at ucc.edu.gh|kwesi.quagraine at teog.de|
>>> Mobile: +233266173582 <+233%2026%20617%203582>
>>> Skype: quagraine_cwasi
>>> Twitter: @Pkdilly
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
> Try not to become a man of success but rather a man of value-Albert
> Einstein
>
> University of Cape Coast|College of Agriculture and Natural Sciences|Department
> of Physics|
> Team Leader|Recycle Up! Ghana|Technology Without Borders|
> Other emails: kwesi.quagraine at ucc.edu.gh|kwesi.quagraine at teog.de|
> Mobile: +233266173582 <+233%2026%20617%203582>
> Skype: quagraine_cwasi
> Twitter: @Pkdilly
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170119/d0927f22/attachment.html 


More information about the ncl-talk mailing list