fix-redshift-minus-one-lib_tools-gravwaves#133
Open
shreyas-tiruvaskar wants to merge 2 commits intonanograv:mainfrom
Open
fix-redshift-minus-one-lib_tools-gravwaves#133shreyas-tiruvaskar wants to merge 2 commits intonanograv:mainfrom
shreyas-tiruvaskar wants to merge 2 commits intonanograv:mainfrom
Conversation
Contributor
Author
|
Even though I have used -np.inf, more robust and safe option would be using np.nan. Although, it would mean more changes in different relevant files. I didn't do it because of time constraints. |
Collaborator
|
@lzkelley This was the PR I was talking about in our zoom. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Setting redz=-1.0 for the binaries not merging within the age of the universe causes problems. -1 is used as a flag to identify such binaries, but that redshift value is used in averaging, which can cause troubles.
While converting the redz_final from (91, 81, 101, 5) to (90, 80, 100, 5), i.e. going from bin edges to bin midpoints, the average is taken of the 8 vertex redshift values to obtain an average bin mid-point value. That -1 was creating problem by occasionally causing very small positive midpoint redshift values.
My fix changes the flag value from -1 to -np.inf in librarian/lib_tools.py. So that in averaging, the result can't become accidentally positive.
This, however, creates nan values for those bins in gravwaves.py hs calculation in the function char_strain_sq_from_bin_edges_redz. I fix that by simply applying a filter there.