Skip to content

Commit

Permalink
nbody modes + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Pearson committed Oct 24, 2023
1 parent 129d85d commit 4eb7eac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/nbody/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The lomb-scargle periodogram from our ephemeris fitting code can be used to esti

![](ttv_prior.png)

The example code has recently been refactored from [Nbody-AI](https://github.com/pearsonkyle/Nbody-ai) and is still in development. Some retrievals not work entirely... please be paitent and report any issues to our slack.
The example code has recently been refactored from [Nbody-AI](https://github.com/pearsonkyle/Nbody-ai) and is still in development. Some retrievals may not work entirely... please be paitent and report any issues to our slack.

If you make use of this code please cite:

Expand Down
9 changes: 5 additions & 4 deletions exotic/api/nbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ def lomb_scargle(t,y,dy=None, min_freq=None, max_freq=None, npeaks=0, peaktol=0.
peak_periods = 1./freq[peaks]
return freq,power,peak_periods


def report(data, savefile=None):

# set up simulation summary report
Expand Down Expand Up @@ -578,18 +577,19 @@ def loglike(pars):
#ttv1,m1,b1 = TTV(self.orbit, self.data[i]['Tc'])
# could be unstable orbit or not enough data
# switch to average error and clip by max epoch?
print(self.prior)
# print(self.prior)
chi2 += -1e6
continue

Tc_sim += residual.mean()
import pdb; pdb.set_trace
Tc_sim += residual.mean() # why?

# take difference between data and simulation
try:
chi2 += -0.5*np.sum(((self.data[i]['Tc'] - Tc_sim[self.orbit])/self.data[i]['Tc_err'])**2)
except:
chi2 += -1e6
print(self.prior)
# print(self.prior)
# usually unstable orbit

return chi2
Expand Down Expand Up @@ -729,6 +729,7 @@ def prior_transform(upars):
{} # data for outer planet (e.g. Mid-transit times)
]

# TODO break P,m modes into individual runs

# set up where to look for a solution
nbody_bounds = [
Expand Down

0 comments on commit 4eb7eac

Please sign in to comment.