<html>#2755: bugs in POWER code
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Anuj Kankani</td></tr>
<tr><td style='text-align:right'> Status:</td><td>submitted</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'> Version:</td><td></td></tr>
<tr><td style='text-align:right'> Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td></td></tr>
</table>
<p>I noticed two bugs in the POWER code (<a data-is-external-link="true" href="https://git.ncsa.illinois.edu/elihu/Gravitational_Waveform_Extractor" rel="nofollow">https://git.ncsa.illinois.edu/elihu/Gravitational_Waveform_Extractor</a>) that I have l listed below.</p>
<ol>
<li>Running the code as is on the GW150914 gallery example does not match the reference waveform provided. I believe this is due to lines 601-624 in the code, in the POWER function, where the amplitude and phase are fit to polynomials and extrapolated. Replacing these lines with numpy polyfit seems to fix the issue as far as I can tell, and I have provided a plot comparing the reference waveform with and without the fix. The code I used to replace line 601 and down is </li>
</ol>
<div class="codehilite"><pre><span></span><span class="n">#Extrapolate</span><span class="w"></span>
<span class="w"> </span><span class="n">phase_extrapolation_order</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="w"> </span><span class="n">amp_extrapolation_order</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="w"></span>
<span class="w"> </span><span class="n">radii</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">np</span><span class="p">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">radii</span><span class="p">,</span><span class="w"> </span><span class="n">dtype</span><span class="o">=</span><span class="nc">float</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">b_phase</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">np</span><span class="p">.</span><span class="n">empty</span><span class="p">(</span><span class="n">dtype</span><span class="o">=</span><span class="n">radii</span><span class="p">.</span><span clas
<p><table><tr><td>attachment:</td><td><a href="https://api.bitbucket.org/2.0/repositories/einsteintoolkit/tickets/issues/2755/attachments/waveform-comparison.png">waveform-comparison.png</a></td></tr>
</table></p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2755/bugs-in-power-code'>https://bitbucket.org/einsteintoolkit/tickets/issues/2755/bugs-in-power-code</a></p>
</html>