<div dir="ltr"><div><div><br>Not sure I understand<br><br><a href="http://www.ncl.ucar.edu/Applications/bootstrap.shtml">http://www.ncl.ucar.edu/Applications/bootstrap.shtml</a><br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml</a><br><br>====<br></div>ntim = dimsizes(time)<br><span class="gmail-m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">iwo = generate_sample_indices(ntim,0) ; <b>entire</b> period<br><br></font></span></div><div><span class="gmail-m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">ntim80 = toint(0.80*ntim)<br></font></span></div><span class="gmail-m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">iwo80 = iwo(0:</font></span><span class="gmail-m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif"><span class="gmail-m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">ntim80-1) ; extract the 1st 80% of the indices<br><br>====<br><br></font></span></font></span><div><br><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 1, 2018 at 10:06 AM, Andrew Kren - NOAA Affiliate <span dir="ltr"><<a href="mailto:andrew.kren@noaa.gov" target="_blank">andrew.kren@noaa.gov</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">Dear ncl-talk,<div><br></div><div>This is more of a science question than a coding issue. I noticed ncl has the function generate_sample_indices to resample with and without replacement. My data is temperature and moisture retrievals as function of (time,lev). The issue I am tackling is that my data has a high temporal frequency. I want to thin the data prior to assimilating it in the HWRF. The data is reported at approximately every 2-3 seconds for a full 24 hours. So I have a lot of measurements and want to thin it.</div><div><br></div><div>I did a test where I retain 80% of the data randomly:</div><div><br></div><div>
<span></span>
<p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">; generate indices for resampling without replacement to sub-sample the HAMSR data</font></span></p>
<p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">n_retain = toint(ceil(0.8*dimsizes(time))<wbr>)</font></span></p>
<p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">print(dimsizes(time))</font></span></p>
<p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">iwo = generate_sample_indices(n_<wbr>retain,0)</font></span></p>
<p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">print(dimsizes(iwo))</font></span></p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif"><br></font></span></p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, helvetica, sans-serif">
<span></span>
</font></span></p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures">14398 - dimsizes(time)</span></font></p><font face="arial, helvetica, sans-serif">
<p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_6899555839379928559gmail-s1" style="font-variant-ligatures:no-common-ligatures">11519 - dimsizes(iwo)</span></p>
</font><p></p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)">However, I noticed that maybe this may not be correct since it will only select n_retain values, and thus may not randomly get indices from the full dataset to subset. Is there a way to do this with the function without having to do replacement?</p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></p><p class="m_6899555839379928559gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)">Thanks,</p><span class="HOEnZb"><font color="#888888">
<br clear="all"><div><br></div>-- <br><div class="m_6899555839379928559gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>Andrew Kren<br>Assistant Scientist<br>CIMAS & NOAA/AOML<br>
325 Broadway, Boulder, CO 80305<br>
<a href="tel:%28303%29%20497-5418" value="+13034975847" target="_blank">(303) 497-5418</a><span><font color="#888888"><br>
</font></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>