lass="n">subtide_freq</span><span class="o">*</span><span class="n">t</span><span class="p">)</span>

    <span class="n">tide</span><span class="p">[</span><span class="n">nanstart</span><span class="p">:(</span><span class="n">nanstart</span><span class="o">+</span><span class="n">numnan</span><span class="p">)]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span>
    <span class="n">dr</span> <span class="o">=</span> <span class="n">pd</span><span cl