bugs in POWER code

Issue #2755 resolved
Anuj Kankani created an issue

I noticed two bugs in the POWER code (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!

Comments (13)

  1. Roland Haas

    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.

  2. Log in to comment