Skip to content

Instantly share code, notes, and snippets.

@j-faria
Created August 29, 2018 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-faria/36d3c8e8db3aa30bde1b126f6d9a253f to your computer and use it in GitHub Desktop.
Save j-faria/36d3c8e8db3aa30bde1b126f6d9a253f to your computer and use it in GitHub Desktop.
How to get those constants in the exoplanet RV amplitude / mass equations!
import astropy.constants as c
import astropy.units as u
from math import pi
C = (2*pi*c.G)**(1/3)
# K [m/s] = C1 ....
C1 = C.to( (u.meter/u.second) * u.year**(1/3.) * (1/u.M_jup) * u.M_sun**(2/3.) ).value
# mp sini [Mjup] = C2 ....
C2 = (1/C).to( u.M_jup / ms / u.day**(1/3) / u.M_sun**(2/3) ).value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment