exoplanet-dev / exoplanet

Fast & scalable MCMC for all your exoplanet needs!
https://docs.exoplanet.codes
MIT License
206 stars 52 forks source link

Assuming n planets #108

Closed kevinkhu closed 4 years ago

kevinkhu commented 4 years ago

In the putting it all together example I am running into plotting problems if I assume there is only one planet to be found with BLS:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-19-6887afec0caf> in <module>
      3 for i in range(len(bls_results)):
      4     # Plot the periodogram
----> 5     ax = axes[i, 0]
      6     ax.axvline(np.log10(periods[i]), color="C1", lw=5, alpha=0.8)
      7     ax.plot(np.log10(bls_results[i].period), bls_results[i].power, "k")

IndexError: too many indices for array

The rest of the code works great (with the minor sampling hack) for the example problem, but there are a couple areas that could be a little more generalized for people who want to adapt the code for use on other systems. This is mostly applicable in the model section where most of the 'shape' parameters can be changed based on len(bls_results) rather than hard coded.

pip, exoplanet 0.3.2, matplotlib 3.3.0, Python 3.7.6, Ubuntu 18.04

dfm commented 4 years ago

This isn't really a bug - the tutorials aren't meant to be just copy paste material! I'm going to close this issue as a wontfix, but I'd welcome a pull request (probably to https://github.com/exoplanet-dev/case-studies) if you wanted to add words about this!