Skip to content

Removing astropy.constants.G from various calculations#1975

Merged
abhisrkckl merged 3 commits intonanograv:masterfrom
dlakaplan:noG
Apr 3, 2026
Merged

Removing astropy.constants.G from various calculations#1975
abhisrkckl merged 3 commits intonanograv:masterfrom
dlakaplan:noG

Conversation

@dlakaplan
Copy link
Copy Markdown
Contributor

To improve consistency, removing astropy.constants.G from various derived quantities in favor of pint.GMsun or pint.Tsun. The differences are small, ~1e-10. And issues are still possible (e.g., if a mass is input in kg instead of Msun, it will still need to be converted). But this is better (I think).

@dlakaplan
Copy link
Copy Markdown
Contributor Author

Note that there is still extensive use of c.G in the DDGR model. That should probably also be fixed.

@dlakaplan
Copy link
Copy Markdown
Contributor Author

Note that there is still extensive use of c.G in the DDGR model. That should probably also be fixed.

Now this has been fixed too.

@dlakaplan dlakaplan added the awaiting review This PR needs someone to review it so it can be merged label Mar 27, 2026
@dlakaplan
Copy link
Copy Markdown
Contributor Author

As a related note, our value of G*Msun:

 Following are from here:
# http://ssd.jpl.nasa.gov/?constants (grabbed on 30 Dec 2013)
GMsun = 1.32712440018e20 * u.m**3 / u.s**2

has a newer value:

1.32712440041279419e20

from the website cited above. Fractional difference is ~1e-10. But we generally don't claim absolute precision at this level (for things like masses) so I'm not sure it's worth changing.

@abhisrkckl
Copy link
Copy Markdown
Contributor

I will merge this if ready.

@dlakaplan
Copy link
Copy Markdown
Contributor Author

I think it's ready if you don't have further issues (I agree some of it is not optimal, but not sure what else to do)

@abhisrkckl abhisrkckl merged commit 6aa4aa0 into nanograv:master Apr 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review This PR needs someone to review it so it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants