stevengiacalone / triceratops

Tool for Rating Interesting Candidate Exoplanets and Reliability Analysis of Transits Originating from Proximate Stars
https://triceratops.readthedocs.io
MIT License
20 stars 7 forks source link

Major (2x) code speedup with minimal changes to the code #2

Closed hpparvi closed 3 years ago

hpparvi commented 4 years ago

Hi Steven,

Great work with the package :)

Here is a simple change that leads to a major (2x) speedup. I changed the code to use PyTransit instead of Batman to calculate the light curves. This leads to 2 times faster evaluation speed of the example notebook cases without changing the results (because the generated light curves are identical).

If you're happy with the change, I can probably accelerate the code significantly more (5-20 times faster) by switching it to use PyTransit's parallelised LC evaluation methods.

Cheers, Hannu

stevengiacalone commented 3 years ago

Hi Hannu,

Thank you, and apologies for taking so long to get to this! I'm glad that it's able to speed up the calculations so dramatically. I am going to make a few minor changes to the EB secondary eclipse depth calculation, but otherwise your changes look perfect. Thanks for the addition.

Switching to PyTransit's parallelization method sounds great. In fact, I was looking for something exactly like this when first designing triceratops! Based on the PyTransit readthedocs, implementing parallization will require a deeper dive into my code. That said, I would be happy to make that change on my end. I'm currently making a number of updates of varying complexities, so I will add it to my list.

Best, Steven