[ncl-talk] runave and missing values

Maria Gehne - NOAA Affiliate maria.gehne at noaa.gov
Thu Feb 5 13:20:34 MST 2015


Hi Carl,

I don't have a solution for you, but I would definitely be interested in a
function that does that.

Maria

On Thu, Feb 5, 2015 at 10:49 AM, Carl Schreck <cjschrec at ncsu.edu> wrote:

> Is there a version of runave that will average all nonmissing values? In
> the current version, if there is even one missing value within a window,
> the average is set to missing.
>
> For example:
> ncl 0> x = ispan( 1, 15, 1 )
> ncl 1> x at _FillValue = -99
> ncl 2> x(8) = x at _FillValue
> ncl 3> y = runave( x, 5, 1 )
> ncl 4> print( x + " " + y )
> (0) 1 2.2
> (1) 2 2.4
> (2) 3 3
> (3) 4 4
> (4) 5 5
> (5) 6 6
> (6) 7 -99
> (7) 8 -99
> (8) -99 -99
> (9) 10 -99
> (10) 11 -99
> (11) 12 12
> (12) 13 13
> (13) 14 13.6
> (14) 15 13.8
>
> What I'd like to have happen is something like:
> (0) 1 2.2
> (1) 2 2.4
> (2) 3 3
> (3) 4 4
> (4) 5 5
> (5) 6 6
> (6) 7 6.5   < = = ( 5 + 6 + 7 + 8 ) / 4
> (7) 8 7.75   < = = ( 6 + 7 + 8 + 10 ) / 4
> (8) -99 9   < = = ( 7 + 8 + 10 + 11 ) / 4
> (9) 10 10.25   < = = ( 8 + 10 + 11 + 12 ) / 4
> (10) 11 11.5   < = = ( 10 + 11 + 12 + 13 ) / 4
> (11) 12 12
> (12) 13 13
> (13) 14 13.6
> (14) 15 13.8
>
>
> --
>
> <http://www.cicsnc.org/>
> <http://www.researcherid.com/rid/B-8711-2011>
> * Cyclone <http://www.cyclonecenter.org/>*Center.org
> <http://www.cyclonecenter.org/>  *Carl J. Schreck III, PhD*
> *Research Associate*
> Cooperative Institute for Climate and Satellites NC
> <http://www.cicsnc.org/>
> North Carolina State University <http://ncsu.edu/>
> NOAA's National Climatic Data Center <http://ncdc.noaa.gov/>
> 151 Patton Ave, Asheville, NC 28801
> e: cjschrec at ncsu.edu
> o: +1 828 257 3140
> Publications
> <http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate>
> monitor.cicsnc.org/mjo
>
> _______________________________________________
> 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/20150205/93ff19e8/attachment.html 


More information about the ncl-talk mailing list