- marked as major
- changed component to Other
-
assigned issue to
bugs in POWER code
I noticed two bugs in the POWER code (https://git.ncsa.illinois.edu/elihu/Gravitational_Waveform_Extractor) that I have l listed below.
- 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!
Comments (13)
-
-
Ouch, very wrong indeed. Thanks for the report. I will try and incorporate them as soon as I can.
The angular momentum expression is probably one of those things that no one quite remembers where they got it from I (RH) can try and poke Eliu (EAH). Maybe he still recalls.
-
- changed status to open
-
I created a branch rhaas/fixes on the new POWER repo: https://github.com/NCSAGravity/Gravitational_Waveform_Extractor/pull/1
-
Applied as git hash 92d5b3a "POWER: correct angular momentum expression" of Gravitational_Waveform_Extractor
-
- changed status to resolved
-
- changed status to open
The applied fix was incorrect (would set angular momentum to 0 all the time...). Fixed in master in bbcc63e "POWER: correct expression for angular momentum once more" of Gravitational_Waveform_Extractor.
Should be backported.
-
Pull request to backport is https://github.com/NCSAGravity/Gravitational_Waveform_Extractor/pull/2:
-
Please review.
-
looks good, sorry for not catching it the first time.
-
Applied as git hash bbcc63e "POWER: correct expression for angular momentum once more" of Gravitational_Waveform_Extractor
Backported to 2023_11 as git hash 3db0d59 "POWER: correct expression for angular momentum once more" of Gravitational_Waveform_Extractor
-
@Anuj Kankani thank you for reviewing.
-
- changed status to resolved
- Log in to comment