Analysis script
holy rupnil judgement
so if you dont know in this project i am just getting the light curve
data from a library, other than that i am doing EVERYTHING from scratch,
so this is the 7 hour dev log of what i did in my analysis script.
bls.py
most time was spent here trying to write Box Least Square algorithm
from scratch, it will be used to find the orbital period of the planet
from the folded data, i wrote various versions in order to find the
correct and best way to do it and had to fix shit ton of bugs, which i
wrote down for this dev log (check below)
analysis.py
after lot of rough work focused around Kepler 8 star in bls.py i
transfered the BLS and other refining functions to analysis script for a
proper cli, it takes detrended data json file and outputs:
- orbital period of planet
- confidence score (calculated from depth of transit)
- duration of transit (calculated two different ways)
- phase start
hella problems i faced
- performance in BLS algo: the very first version i wrote had a triple
loop, it was like 2+ billion operations so it was taking like 7 minutes
to complete and give wrong orbital period, then i switched to numpy to
use vectorization and it made it hella fast, dropped the time to just 60
seconds - “aliases”: later i found out that i was not getting wrong orbital
period it was just different multiples of the period, so i had to make a
functioncheck_aliaseswhich gets the first 4 values of period it
could find and thealiases[0]is the best one with highest score - precision: the values were never precise and the reason was that the
BLS seach wasnt enough, what i needed to do was a coarse search and get a
general idea of transt and do a more precise search on top of the
coarse values which i did with a function i madebls_search_two_pass
who’s period was then correct but with lower score and another multiple
was still with higher score, so after hella digging i found that it was a
like chicken and egg problem yk, see the BLS search needsdurationto
calculate stuff better and we dont know that duration, we can get the
duration by doing some calculations on period but to get period we need
to do BLS search, so at first i used a constant value0.4of duration
after some manual experimenting, which works as a decent enough
heuristic at first, then after we get a nice period i use the
refine_durationfunction which then digs in and calculates the best
duration value, which is THEN used to run another BLS search this time
with proper suitable duration. so it went like:bls coarse search
->bls precise search->bls alias calculation->duration refining->anoher precise searchand then we come to proper
orbital period with highest score, FINALLY.
this dev log was MUCH bigger but got deleted cuz it wasnt saved and this fucking error deleted it, now i am too frustrated and idc enough to write it completey again this is all i had saved
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.