[ncl-talk] No valid values in scalar field

Dennis Shea shea at ucar.edu
Sun Jun 19 06:51:59 MDT 2016


I think you already posted this question.

You did not do As I suggested:

1]
The 'golden-rule' of data processing is **look at your data**.
Did you look at the variable?

file   = "dox_mean_2010_05x05.nc"
a = addfile(file,"r")
dox   = a->ozone        ;720x360x24

do i=0,2   ; 23
    printMinMax(dox(:,:,i), 0)  ; print Min and max for each level
end do

Maybe the values are all _FillValue.

===

[2]
Please use the following simple code. This illustrates what you get when
you try to plot a variable that contains only  _FillValue

  x    = new ( (/50,30/), "float", 1e10)                 ; all _FillValue
  wks  = gsn_open_wks("x11","tst_FillValue")
  plot = gsn_csm_contour(wks,x,False)            ; contour the variable


warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot
not possible:[errno=1101]

On Sat, Jun 18, 2016 at 9:22 AM, Ciao Kai Liang <ciaokailiang at gmail.com>
wrote:

> Hi,
>
> I have one variable "dox" with (360x720x24). It is ozone global map and
> contains 24 different perturbation results. I would like to plot them on
> multiple panels in a single sheet. However, I don't know why I can't plot
> the first 3 (see pic). The output of "dox"from printVarSummary and plotting
> script shows below.
>
> Thx
> CiaoKai
>
>
> dox-----------------------------------------------------------------------------
> Variable: dox
> Type: float
> Total Size: 24883200 bytes
>             6220800 values
> Number of Dimensions: 3
> Dimensions and sizes:   [lat | 360] x [lon | 720] x [24]
> Coordinates:
>             lat: [-89.75..89.75]
>             lon: [-179.75..179.75]
> Number Of Attributes: 1
>   _FillValue :  9.96921e+36
>
> plot
> script----------------------------------------------------------------------------------------------
>
> plots = new(24,graphic)
>   wks_type = "png"
>   wks_name = "dox_panel"
>   wks = gsn_open_wks(wks_type,wks_name)         ; send graphics to PDF file
>
>   res                              = True
>   res at gsnDraw              = False              ; don't draw
>   res at gsnFrame             = False              ; don't advance frame
>
>   res at cnLevelSelectionMode = "ManualLevels"     ; set manual contour
> levels
>   res at cnMinLevelValF       = -2.                ; set min contour level
>   res at cnMaxLevelValF       =  2.                ; set max contour level
>   res at cnLevelSpacingF      =  1.                ; set contour spacing
>
>   res at cnFillOn          = True
>   res at cnLinesOn         = False
>   res at cnLineLabelsOn    = False
>   res at lbLabelBarOn      = False
>   res at cnFillPalette     = "BlWhRe"              ; Blue-Red colormap
>   res at gsnRightString    = "ppb"                 ; "~" is txFuncCode
>
>   leftstring = (/"a","g","m","b","h","n",\
>                  "c","i","o","d","j","p",\
>                  "e","k","q","f","l","r",\
>                  "s","t","u","v","w","X"/)
>
>   do i=0,23
>     res at gsnLeftString  =  "("+leftstring(i)+")"
>     plots(i) = gsn_csm_contour_map_ce(wks,dox(:,:,i),res)
>   end do
>
>   pnlres = True
>   pnlres at txString          = "Dox"
>   pnlres at gsnPanelLabelBar  = True
>   pnlres at lbLabelAutoStride = True
>
>   gsn_panel(wks,plots,(/6,4/),pnlres)
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20160619/6c64cffb/attachment.html 


More information about the ncl-talk mailing list