-
Notifications
You must be signed in to change notification settings - Fork 19
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
Prior uniform in m1-m2 space with a bound in chirp mass and mass ratio #164
Closed
Closed
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dd2af0c
Adding conditional transform for m2 given m1
tsunhopang ee071a0
m1m2 bugfix 1
tsunhopang ffdbf83
fixing typo
tsunhopang 259bae0
attempt to fix Pv2 test script
tsunhopang 0320a53
m1m2 bugfix 2
tsunhopang afe4e9a
Adding m1-m2 into GW150914 Pv2 testing
tsunhopang 1a67bf9
Adding return typing for Mc_m1_to_m2, and only return the real root i…
tsunhopang 0a475f7
Replacing m2 transform with a prior wrapper
tsunhopang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,31 @@ def inner_product( | |
return 4.0 * jnp.real(trapezoid(integrand, dx=df)) | ||
|
||
|
||
def Mc_m1_to_m2(Mc: Float, m1: Float): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return typing hint is missing here |
||
|
||
a = jnp.power(m1, 3.0) | ||
b = 0.0 | ||
c = -jnp.power(Mc, 5.0) | ||
d = -jnp.power(Mc, 5.0) * m1 | ||
|
||
f = ((3.0 * c / a) - ((b**2) / (a**2))) / 3.0 | ||
g = (((2.0 * (b**3)) / (a**3)) - ((9.0 * b * c) / (a**2)) + (27.0 * d / a)) / 27.0 | ||
g_squared = g**2 | ||
f_cubed = f**3 | ||
h = g_squared / 4.0 + f_cubed / 27.0 | ||
|
||
R = -(g / 2.0) + jnp.sqrt(h) | ||
S = jnp.cbrt(R) | ||
T = -(g / 2.0) - jnp.sqrt(h) | ||
U = jnp.cbrt(T) | ||
|
||
x1 = (S + U) - (b / (3.0 * a)) | ||
x2 = -(S + U) / 2 - (b / (3.0 * a)) + (S - U) * jnp.sqrt(3.0) * 0.5j | ||
x3 = -(S + U) / 2 - (b / (3.0 * a)) - (S - U) * jnp.sqrt(3.0) * 0.5j | ||
|
||
return jnp.array([x1, x2, x3]) | ||
|
||
|
||
def m1_m2_to_M_q(m1: Float, m2: Float): | ||
""" | ||
Transforming the primary mass m1 and secondary mass m2 to the Total mass M | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a transform or a prior? Also, is this used in the testing script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a transform