Attempt to fix heterodyned likelihood #40
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to fix the heterodyned likelihood, as raised in the issue #39
Specifically, I have edited the slicing of the waveforms in the following manner:
The previous version crashed when trying to slice the waveforms, since these are dictionaries. I have changed the code so that the slices are applied to both polarizations present in the dictionary.
The masks for slicing were created from the frequency grids. However, the previous version could result in a mismatch in size if the maximum of the valid frequency grid max(f_valid) is in between f_min and f_center of a particular bin of the relative binning. Now, I have created the masks based on the central frequencies grid, and sliced both the f_lower and f_center frequency grids of the heterodyned likelihood with this single mask.
A small edit changed the location where n_bins+1 was placed in the internal computations of the relative binning, as the old implementation was confusing me. This should not affect the execution of the code.
With these changes, the GW150914.py example script is able to run, thereby seemingly solving #39. However, I have not checked whether the obtained results make sense, as I first want to have this code reviewed by the original creators of jim.