[ncl-talk] No valid values in scalar field

Dennis Shea shea at ucar.edu
Thu Jun 16 10:38:04 MDT 2016


[1]
The 'golen-rule' od 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)
end do

Maybe the values are all _FillValue.

[2]
Please read the NCL documenttion. Upon import ...

a       = addfile(file,"r")
dox   = a->ozone
printVarSummary(dox)

As you can see ... all the appropriate meta data is automatically
associated with the variable. As a result, none of this is necessary:

at_pts     = a->lat(:)
lon_pts     = a->lon(:)

;======================================
dox!0="lat"
dox!1="lon"
dox&lat = lat_pts
dox&lon = lon_pts
dox&lat at units="degrees_north"
dox&lon at units="degrees_east"


[3]
dox   = a->ozone

is more efficient than

dox   = a->ozone(:,:,:)






On Thu, Jun 16, 2016 at 9:25 AM, Ciao Kai Liang <ciaokailiang at gmail.com>
wrote:

> Hi
>
> I have a metric dox(720,360,24). It is 24 different ozone concentration
> across globe. I try to use gsn_panel to plot them at one single sheet but I
> don't know why my first three plot (see attached) couldn't show properly
> and the below message pops out.
>
> warning:ContourPlotInitialize: no valid values in scalar field;
> ContourPlot not possible:[errno=1101]
>
> ;dox====================================
> below is dox for details
> 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
>
>
> ;source code============================
> file   = "dox_mean_2010_05x05.nc"
> a = addfile(file,"r")
> lat_pts     = a->lat(:)
> lon_pts     = a->lon(:)
> dox   = a->ozone(:,:,:) ;720x360x24
> ;======================================
> dox!0="lat"
> dox!1="lon"
> dox&lat = lat_pts
> dox&lon = lon_pts
> dox&lat at units="degrees_north"
> dox&lon at units="degrees_east"
> ;=====================================
> plots = new(24,graphic)
> wks_type = "pdf"
> wks_name = "htap2_dox_panel"
> wks_type at wkPaperSize = "A4"
> wks = gsn_open_wks(wks_type,wks_name)      ; send graphics to PDF file
>
>  res                                = True
>  res at gsnMaximize       = True               ;If set to True, plot will be
> maximized
>  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       = -5.                ; set min contour level
>  res at cnMaxLevelValF       =  5.                ; set max contour level
>
> 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
>
> do i=0,23
>     plots(i) = gsn_csm_contour_map_ce(wks,dox(:,:,i),res)
>  end do
>
> pnlres = True
> pnlres at txString                   = ""
> pnlres at gsnPanelLabelBar  = True
> pnlres at lbLabelAutoStride   = True
>
>  gsn_panel(wks,plots,(/6,4/),pnlres)
>
> end
>
>
> Joe
>
> University of North Carolina, Gillings School of Global Public Health
> 170 Rosenau Hall, CB #7400 | 135 Dauer Drive | Chapel Hill, NC 27599-7400
>
> _______________________________________________
> 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/20160616/a58152e0/attachment.html 


More information about the ncl-talk mailing list