[ET Trac] #2755: bugs in POWER code

Anuj Kankani trac-noreply at einsteintoolkit.org
Thu Aug 31 11:39:17 CDT 2023


#2755: bugs in POWER code

 Reporter: Anuj Kankani
   Status: submitted
Milestone: 
  Version: 
     Type: bug
 Priority: minor
Component: 

I noticed two bugs in the POWER code \([https://git.ncsa.illinois.edu/elihu/Gravitational\_Waveform\_Extractor](https://git.ncsa.illinois.edu/elihu/Gravitational_Waveform_Extractor)\)  that I have l listed below.

1. 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 

```
#Extrapolate
        phase_extrapolation_order = 1
        amp_extrapolation_order = 2
        radii = np.asarray(radii, dtype=float)

        b_phase = np.empty(dtype=radii.dtype, shape=(len(radii), len(t)))
        b_amp = np.empty(dtype=radii.dtype, shape=(len(radii), len(t)))

        for j in range(len(radii)):
            b_phase[j] = phase[j][:, 1]
            b_amp[j] = amp[j][:, 1]
        
        radially_extrapolated_amp=np.polyfit(1/radii,b_amp,amp_extrapolation_order)[-1]
        radially_extrapolated_phase=np.polyfit(1/radii,b_phase,phase_extrapolation_order)[-1]
        
        radially_extrapolated_h_plus = radially_extrapolated_amp * np.cos(radially_extrapolated_phase)
        radially_extrapolated_h_cross = radially_extrapolated_amp * np.sin(radially_extrapolated_phase)

        extrapolated_strains[None][el,em] = np.column_stack((t, radially_extrapolated_h_plus, radially_extrapolated_h_cross))
    return extrapolated_strains
```

‌

2\. In the `getCutoffFrequencyFromTwoPuncturesBBH` function lines 341-351 have incorrect equations for angular momentum. It looks like a typo between position and momentum in the second term. For example one equation is given as 

`angularmomentum1x = position1y * momentum1z - momentum1z * momentum1y`

‌

These are just two bugs I have found, I haven’t checked the whole code.

 Also, in the angular\_momentum function, it says 

```
# RH: expression was originally provided by EAH
    # TODO: get referecen for this from EAH
```

I was just wondering if you had a reference for the equation used?

‌

Thanks!

‌
attachment: waveform-comparison.png (https://api.bitbucket.org/2.0/repositories/einsteintoolkit/tickets/issues/2755/attachments/waveform-comparison.png)


--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2755/bugs-in-power-code
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20230831/36959423/attachment.htm>


More information about the Trac mailing list