[ncl-talk] no valid values in scalar field; ContourPlot not possible:[errno=1101]

Adam Phillips asphilli at ucar.edu
Thu Aug 6 10:28:38 MDT 2015


Hi Sebastián,
Try moving your copy_VarCoords line down beneath this line:
sst_avg(0,:,:)=sst_avg(0,:,:)/times

Also, note that there is a function that will average over a dimension:
https://www.ncl.ucar.edu/Document/Functions/Contributed/dim_avg_n_Wrap.shtml

You could change all this:
sst at missing_value = 0.
 sst at _FillValue = 0.

 printVarSummary(sst)
 times=dimsizes(sst(:,0,0))
 row  = dimsizes(sst(0,:,0))
 col  = dimsizes(sst(0,0,:))
 sst_avg = new((/times,row,col/),"float",0)
         do it =0,times-1
             sst_avg(0,:,:)=sst_avg(0,:,:)+sst(it,:,:)
         end do
 sst_avg(0,:,:)=sst_avg(0,:,:)/times
 copy_VarCoords(sst,sst_avg)
 printVarSummary(sst_avg)

to this:
sst_avg = dim_avg_n_Wrap(sst,0)

Finally, note that setting _FIllValue = 0 is completely fine, but you will
likely want to change that before attempting to plot the sst_avg array
(using your original averaging coding) as some of the NCL plotting
functions do not accept _FillValue = 0..

Hope that all helps. If it does not, or if you have further questions,
please respond to the ncl-talk email list.
Adam




On Thu, Aug 6, 2015 at 3:36 AM, Sebastian Otarola-Bustos <
Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:

> Hi everybody,
>
> I'm trying to plot a contour with week average of sst anomalies, but I'm
> having that error. I read that could be because of the coordinates, but I'd
> copied all the cordinates from sst(daily values (time, lat,lon)) to my
> auxiliary sst_avg(week average(time,lat,lon)), despite I don'y need all of
> them( I don't need time), just to be sure. I also tried setting to 0 all
> fill_Values and missing values. I attached you an image where you can see
> the summary of my two variables(sst & sst_avg), and I'm showing the
> essential part of the script:
>
>
> sst = a->anom(:,:,:)    ; times, lat ,lon
>  sst at missing_value = 0.
>  sst at _FillValue = 0.
>
>  printVarSummary(sst)
>  times=dimsizes(sst(:,0,0))
>  row  = dimsizes(sst(0,:,0))
>  col  = dimsizes(sst(0,0,:))
>  sst_avg = new((/times,row,col/),"float",0)
>  copy_VarCoords(sst,sst_avg)
>  printVarSummary(sst_avg)
>          do it =0,times-1
>              sst_avg(0,:,:)=sst_avg(0,:,:)+sst(it,:,:)
>          end do
>  sst_avg(0,:,:)=sst_avg(0,:,:)/times    ; Calculo anomalia semanal promedio
>
>  wks_type            = "png"
>  wks_type at wkWidth    = 1700
>  wks_type at wkHeight   = 1536
>  wks = gsn_open_wks(wks_type,"animate")
>  mpid    = gsn_csm_map(wks,mpres)
>  ST  = gsn_csm_contour(wks,sst_avg(0,:,:),Tres)
> ;Overlaps maps in order
>  overlay(mpid,ST)
>  maximize_output(wks,True)
>
>
>  Any suggestion to try new direction would be really appreciated.
>
> Best regards,
> Sebastián.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150806/6f3df62d/attachment.html 


More information about the ncl-talk mailing list