Skip to content

Commit

Permalink
Merge pull request #199 from sblunt/radvel_utils-return-mp
Browse files Browse the repository at this point in the history
compute_sep should also return mp. Also addresses #200 (`astropy._erfa` deprecation).
  • Loading branch information
sblunt authored Jan 25, 2021
2 parents a12d20d + 03247e5 commit 6cc27f9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ before_install:

install:
- conda install --yes python=$TRAVIS_PYTHON_VERSION pip numpy scipy cython matplotlib
- pip install pytest pytest-cov coverage coveralls corner deprecation rebound
- pip install pytest pytest-cov coverage coveralls corner deprecation rebound pyerfa
- pip install . --upgrade
- python setup.py build_ext -i

Expand Down
8 changes: 4 additions & 4 deletions orbitize/radvel_utils/compute_sep.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def compute_sep(
cosi = (2. * np.random.random(size = chain_len)) - 1.
inc = np.arccos(cosi)
m_pl = msini / np.sin(inc)
mtot = m0 + m_pl
mtot = m_st + m_pl
sma = (period_yr**2 * mtot)**(1/3)
omega_st_rad = df['w{}'.format(pl_num)].values
omega_pl_rad = omega_st_rad + np.pi
Expand All @@ -80,11 +80,11 @@ def compute_sep(
seps = np.sqrt(raoff**2 + deoff**2)

df_orb = pd.DataFrame(
np.transpose([sma, ecc, inc, omega_pl_rad, lan, tau, parallax, mtot]),
np.transpose([sma, ecc, inc, omega_pl_rad, lan, tau, parallax, m_st, m_pl]),
columns=[
'sma', 'ecc', 'inc_rad', 'omega_pl_rad', 'lan_rad', 'tau_58849',
'plx', 'mtot'
'plx', 'm_st', 'mp'
]
)

return seps, df_orb
return seps, df_orb
2 changes: 1 addition & 1 deletion orbitize/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import astropy.constants as consts
from astropy.io import fits
from astropy.time import Time
from astropy._erfa.core import ErfaWarning
from erfa import ErfaWarning

import matplotlib as mpl
import matplotlib.pyplot as plt
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ deprecation
cython
pytest
pandas
radvel
radvel
pyerfa

0 comments on commit 6cc27f9

Please sign in to comment.