[ncl-talk] problem with creating figure

Sunmin Park mireiyue at gmail.com
Wed Jan 28 17:30:26 MST 2015


I check and both data lon is 

Variable: CAL
Type: float
Total Size: 24480 bytes
            6120 values
Number of Dimensions: 2
Dimensions and sizes:	[lat | 85] x [lon | 72]
Coordinates:
            lat: [-85..85]
            lon: [-180..180]
Number Of Attributes: 1
  _FillValue :	-9999
(0)	ExtinctionCAL:  min=0 max=0.00150543

Variable: CAM
Type: float
Total Size: 24480 bytes
            6120 values
Number of Dimensions: 2
Dimensions and sizes:	[LAT | 85] x [LON | 72]
Coordinates:
            LAT: [-85..85]
            LON: [-180..180]
Number Of Attributes: 1
  _FillValue :	1e+20
(0)	ExtinctionCAM:  min=0.000113507 max=0.00374775

and i printed out the values in west it shows missing values -9999
Variable: CALCAM (subsection)
Type: float
Total Size: 168 bytes
            42 values
Number of Dimensions: 2
Dimensions and sizes:	[lat | 6] x [lon | 7]
Coordinates:
            lat: [-4.047619..6.071429]
            lon: [-80..-50]
Number Of Attributes: 1
  _FillValue :	-9999
(0,0)	-9999
(0,1)	-9999
(0,2)	-9999
(0,3)	-9999
(0,4)	-9999
(0,5)	-9999
(0,6)	-9999
(1,0)	-9999
(1,1)	-9999
(1,2)	-9999
(1,3)	-9999
(1,4)	-9999
(1,5)	-9999
(1,6)	-9999
(2,0)	-9999
(2,1)	-9999
(2,2)	-9999
(2,3)	-9999
(2,4)	-9999
(2,5)	-9999
(2,6)	-9999

I think the values changed somehow to missing values.

Sun-


On Jan 28, 2015, at 9:59 AM, Alan Brammer <abrammer at albany.edu> wrote:

> 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/1da95254/attachment.html 


More information about the ncl-talk mailing list