[ncl-talk] problem with creating figure

Sunmin Park mireiyue at gmail.com
Wed Jan 28 10:36:16 MST 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CALIPSO-CAM_UT.ps
Type: image/ps
Size: 394783 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150128/13251cb9/attachment-0001.bin 


More information about the ncl-talk mailing list