[ncl-talk] problem with creating figure

Alan Brammer abrammer at albany.edu
Wed Jan 28 10:59:29 MST 2015


lon = fspan(-180,180,72)

You're lon definition here is creating a cyclic in the longitude
coordinate.   Are the first and last longitude of your data the same or is
this a mistake.  The combination of this and then res at gsnAddCyclic = True
is trying to do the same thing twice and NCL isn't coping.

I'm presuming it is a mistake as a 5.18 degree dataset would be weird.
When creating arrays try printing them once to check it is what you
expected.

It **may** be more likely to have instead have this line
lon = fspan(-180,175,72)

You would have to consult the data docs to know if this is correct.  (or
plot it and see).


~Alan

On Wed, Jan 28, 2015 at 12:36 PM, Sunmin Park <mireiyue at gmail.com> wrote:

> Dear NCL users
>
> I have problem to create plot (attached). I am trying to subtract one data
> to the other one.
> Data, I am reading, have values all over the world.
>
> I appreciate any comments and helps.
> Thank you in advance
> Sun-
> ===========
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
>
> f  = addfile("/Users/spark/vertical/output/D_CAL_UT.nc/","r")
> CAL = f->extGmean
> CAL at _FillValue = getFillValue(CAL)
>
> print("ExtinctionCAL:  min="+min(CAL)+" max="+max(CAL))
>
> f1  = addfile("/Users/spark/vertical/output/D_CAM_UT.nc/","r")
> CAM = f1->extGmean
> CAM at _FillValue = getFillValue(CAM)
> print("ExtinctionCAM:  min="+min(CAM)+" max="+max(CAM))
>
>
> CALCAM = CAL-CAM
> CALCAM!0 ="lat"
> CALCAM!1 = "lon"
> lat = fspan(-85,85,85)
> lon = fspan(-180,180,72)
>
> lat at longname = "latitude"
> lat at units = "degrees_north"
> lon at longname ="longitude"
> lon at units = "degrees_east"
>
> CALCAM&lat = lat
> CALCAM&lon = lon
>
> print("Extinction:  min="+min(CALCAM)+" max="+max(CALCAM))
> print(CALCAM(40:45,20:26))
> printVarSummary(CALCAM)
>
>   wks = gsn_open_wks("ps","CALIPSO-CAM_UT")            ; open a ps file
>   gsn_define_colormap(wks,"gui_default")       ; choose colormap
>
>   res                     = True               ; plot mods desired
>   res at cnFillOn            = True               ; turn on color
>   res at gsnSpreadColors     = True               ; use full color map
>   res at cnLinesOn           = False              ; no contour lines
>   res at cnLineLabelsOn      = False              ; no line labels
>
>   res at mpMaxLatF           = 85                 ; choose map range
>   res at mpMinLatF           = -85
>
>   res at gsnDraw             = False              ; don't draw yet
>   res at gsnFrame            = False              ; don't advance frame yet
>
>   res at gsnAddCyclic        = True
>
> ;  res at cnLevelSelectionMode = "ManualLevels"
>   res at cnLevelSelectionMode =  "AutomaticLevels"   ; AutomaticLevels
> ;  res at cnMinLevelValF       = 0                 ; min level
> ;  res at cnMaxLevelValF       = 0.00007       ; max level
> ;  res at cnLevelSpacingF      = 0.000005      ; interval
>
>   res at tmXBLabelFontHeightF     = 0.014         ; adjust some font heights
>   res at tmYLLabelFontHeightF     = 0.014
>   res at tiMainFontHeightF        = 0.022
>   res at txFontHeightF            = 0.017
>
>   res at lbLabelBarOn             = False        ; turn off label bar
> ;************************************************
> ; create plots
> ;************************************************
>   plot = new(1,graphic)
>
>   res at tiMainString        = "CALIPSO-CAM_UT"
>   plot(0) = gsn_csm_contour_map_ce(wks,CALCAM,res)  ; create the plot
>
> ;************************************************
> ; create panel
> ;************************************************
>   pres                  = True
>   pres at gsnPanelLabelBar = True                   ; common label bar
>   gsn_panel(wks,plot,(/1,1/),pres)
>
>   delete(wks)
>
> end
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150128/77717580/attachment.html 


More information about the ncl-talk mailing list