<div dir="ltr">Hi Carl,<div><br></div><div>I don't have a solution for you, but I would definitely be interested in a function that does that.</div><div><br></div><div>Maria</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 10:49 AM, Carl Schreck <span dir="ltr"><<a href="mailto:cjschrec@ncsu.edu" target="_blank">cjschrec@ncsu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div><br></div><div>For example:</div><div><div>ncl 0> x = ispan( 1, 15, 1 )</div><div>ncl 1> x@_FillValue = -99</div><div>ncl 2> x(8) = x@_FillValue</div><div>ncl 3> y = runave( x, 5, 1 )</div><div>ncl 4> print( x + " " + y )</div><div>(0)<span style="white-space:pre-wrap">        </span>1 2.2</div><div>(1)<span style="white-space:pre-wrap">        </span>2 2.4</div><div>(2)<span style="white-space:pre-wrap">        </span>3 3</div><div>(3)<span style="white-space:pre-wrap">        </span>4 4</div><div>(4)<span style="white-space:pre-wrap">        </span>5 5</div><div>(5)<span style="white-space:pre-wrap">        </span>6 6</div><div>(6)<span style="white-space:pre-wrap">        </span>7 -99</div><div>(7)<span style="white-space:pre-wrap">        </span>8 -99</div><div>(8)<span style="white-space:pre-wrap">        </span>-99 -99</div><div>(9)<span style="white-space:pre-wrap">        </span>10 -99</div><div>(10)<span style="white-space:pre-wrap">        </span>11 -99</div><div>(11)<span style="white-space:pre-wrap">        </span>12 12</div><div>(12)<span style="white-space:pre-wrap">        </span>13 13</div><div>(13)<span style="white-space:pre-wrap">        </span>14 13.6</div><div>(14)<span style="white-space:pre-wrap">        </span>15 13.8</div><div><br></div><div>What I'd like to have happen is something like:</div><div><div>(0)<span style="white-space:pre-wrap">        </span>1 2.2</div><div>(1)<span style="white-space:pre-wrap">        </span>2 2.4</div><div>(2)<span style="white-space:pre-wrap">        </span>3 3</div><div>(3)<span style="white-space:pre-wrap">        </span>4 4</div><div>(4)<span style="white-space:pre-wrap">        </span>5 5</div><div>(5)<span style="white-space:pre-wrap">        </span>6 6</div><div>(6)<span style="white-space:pre-wrap">        </span>7 6.5 < = = ( 5 + 6 + 7 + 8 ) / 4</div><div>(7)<span style="white-space:pre-wrap">        </span>8 7.75 < = = ( 6 + 7 + 8 + 10 ) / 4</div><div>(8)<span style="white-space:pre-wrap">        </span>-99 9 < = = ( 7 + 8 + 10 + 11 ) / 4</div><div>(9)<span style="white-space:pre-wrap">        </span>10 10.25 < = = ( 8 + 10 + 11 + 12 ) / 4</div><div>(10)<span style="white-space:pre-wrap">        </span>11 11.5 < = = ( 10 + 11 + 12 + 13 ) / 4</div><div>(11)<span style="white-space:pre-wrap">        </span>12 12</div><div>(12)<span style="white-space:pre-wrap">        </span>13 13</div><div>(13)<span style="white-space:pre-wrap">        </span>14 13.6</div><div>(14)<span style="white-space:pre-wrap">        </span>15 13.8</div></div><div><br></div><div><br></div>-- <br><div><div dir="ltr"><br><table border="0" cellpadding="2" cellspacing="2" style="max-width:100%;border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-size:14px;border:3px solid rgb(170,170,170);font-family:Times;line-height:12px;background-color:transparent"><tbody><tr><td align="center" height="71" width="71"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><a href="http://www.cicsnc.org/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank"><img src="http://www.cicsnc.org/assets/images/cicsnc-logo.png" width="96" height="93"></a> <a href="http://www.researcherid.com/rid/B-8711-2011" target="_blank"><br></a></span></span><br><font size="4"><b style="text-align:start;color:rgb(38,58,143);font-family:arial,helvetica,sans-serif"> <a href="http://www.cyclonecenter.org/" style="color:rgb(38,58,143);text-decoration:none" target="_blank">Cyclone</a></b><a href="http://www.cyclonecenter.org/" style="text-align:start;color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;text-decoration:none" target="_blank">Center.org</a> </font></td><td valign="top"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><b>Carl J. Schreck III, PhD</b><br><b>Research Associate</b><br><a href="http://www.cicsnc.org/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">Cooperative Institute for Climate and Satellites NC</a> <br><a href="http://ncsu.edu/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">North Carolina State University</a><br><a href="http://ncdc.noaa.gov/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">NOAA's National Climatic Data Center</a><br>151 Patton Ave, Asheville, NC 28801<br>e: </span></span><a href="mailto:cjschrec@ncsu.edu" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">cjschrec@ncsu.edu</a><br style="font-family:arial,helvetica,sans-serif;font-size:11px"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif">o: <a href="tel:%2B1%20828%20257%203140" value="+18282573140" target="_blank">+1 828 257 3140</a><br></span></span><a href="http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">Publications</a><br><a href="http://monitor.cicsnc.org/mjo/" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">monitor.cicsnc.org/mjo</a><br style="font-family:arial,helvetica,sans-serif;font-size:11px"></td></tr></tbody></table></div></div>
</div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>