Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fix passing mode_array in injection-waveform-arguments #820

Merged
merged 9 commits into from
Jan 27, 2025
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ Martin White
Peter Tsun-Ho Pang
Alexandre Sebastien Goettel
Ann-Kristin Malz
Lorenzo Pompili
3 changes: 2 additions & 1 deletion bilby/gw/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_dista
}

if mode_array is not None:
mode_array = [tuple(map(int, mode)) for mode in mode_array]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should wrap these changes in a try/except like here so that we get an informative error if/when this fails for any reason. We can also have a more specific message here as it is a more specific case.

gwsignal_dict.update(ModeArray=mode_array)

# Pass extra waveform arguments to gwsignal
Expand Down Expand Up @@ -528,7 +529,7 @@ def set_waveform_dictionary(waveform_kwargs, lambda_1=0, lambda_2=0):
if mode_array is not None:
mode_array_lal = lalsim.SimInspiralCreateModeArray()
for mode in mode_array:
lalsim.SimInspiralModeArrayActivateMode(mode_array_lal, mode[0], mode[1])
lalsim.SimInspiralModeArrayActivateMode(mode_array_lal, int(mode[0]), int(mode[1]))
adivijaykumar marked this conversation as resolved.
Show resolved Hide resolved
lalsim.SimInspiralWaveformParamsInsertModeArray(waveform_dictionary, mode_array_lal)
return waveform_dictionary

Expand Down
Loading