<div dir="ltr"><div>Well, of course a function (possibly even &#39;runave&#39;, &#39;runave_n&#39;) could be modified to do this,  However, that could cause some issues.  Let &#39;nave=51&#39;  ... All sequences with 51 consecutive values would yield a result that had consistent filter characteristics. Lets say that there is a sequence with only one value ... Would you want that to be returned ... mixed with all other &#39;smoothed&#39; values?<br></div><div><br></div><div>If the number of missing points is &#39;small&#39; I would suggest that <br>         <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/linmsg_n.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/linmsg_n.shtml</a><br></div><div>be used to preprocess the series prior to performing the runave_n script.<br></div><div>Note that this has an option that will only operate a  user specified max length of missing values.<br><br></div><div>D<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 1:32 PM, Adam Phillips <span dir="ltr">&lt;<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Carl/Maria,<br></div>This a not a terribly clean solution, but when I need to do that type of averaging I use the dim_avg* functions which happily ignore the data with _FillValue&#39;s and will average over whatever data is there. The negative to doing this is that you need to call dim_avg multiple times within a do loop:<br><br>ssttemp = sst_t<br>ssttemp = ssttemp@_FillValue<br>do qq = 1,dimsizes(sst_t&amp;time)-3     ; calculate 4-mo running average<br>     ssttemp(:,:,qq) = dim_avg(sst_t(:,:,qq-1:qq+2))  ; missing data allowed<br>end do<br></div>delete(sst_t)<br><div><br></div><div>All that being said, I agree that a version of runave that allows _FillValue data would be useful.. Adam<br></div><div><br><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 1:20 PM, Maria Gehne - NOAA Affiliate <span dir="ltr">&lt;<a href="mailto:maria.gehne@noaa.gov" target="_blank">maria.gehne@noaa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Carl,<div><br></div><div>I don&#39;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">&lt;<a href="mailto:cjschrec@ncsu.edu" target="_blank">cjschrec@ncsu.edu</a>&gt;</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&gt; x = ispan( 1, 15, 1 )</div><div>ncl 1&gt; x@_FillValue = -99</div><div>ncl 2&gt; x(8) = x@_FillValue</div><div>ncl 3&gt; y = runave( x, 5, 1 )</div><div>ncl 4&gt; print( x + &quot; &quot; + 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&#39;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   &lt; = = ( 5 + 6 + 7 + 8 ) / 4</div><div>(7)<span style="white-space:pre-wrap">        </span>8 7.75   &lt; = = ( 6 + 7 + 8 + 10 ) / 4</div><div>(8)<span style="white-space:pre-wrap">        </span>-99 9   &lt; = = ( 7 + 8 + 10 + 11 ) / 4</div><div>(9)<span style="white-space:pre-wrap">        </span>10 10.25   &lt; = = ( 8 + 10 + 11 + 12 ) / 4</div><div>(10)<span style="white-space:pre-wrap">        </span>11 11.5   &lt; = = ( 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 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" border="0" cellpadding="2" cellspacing="2"><tbody><tr><td align="center" width="71" height="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&#39;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&amp;user=th8ONEcAAAAJ&amp;view_op=list_works&amp;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>
<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><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Division, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888"><a href="tel:303-497-1726" value="+13034971726" target="_blank">303-497-1726</a> </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div>
</font></span></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>