Upon reflection, I decided the easiest approach would be to switch to using the 20-sec targets as the reference point because then you again have an integer 10 20-sec cadences making up the new 200-sec FFI cadence.
I believe I made all the necessary changes, and it builds locally and seems to work on a test TOI.
Summary of changes:
Moved the tensorflow imports back inside of functions so that you can import the package without tf being installed.
Switch to using 20-sec CBVs and 20-sec target for quality flags in sectors 56+.
Calculate the cadence number correctly.
The big issue I'm having is in choosing the correct 20-s cadences to use in the CBVs/quality flags.
In both cases, you're uncorrecting the BJD correction to compare times? For some reason, that seems to be correct for the CBVs as far as I can tell (the CBV times do seem to not be BJD corrected).
But in the quality flag section, both the target and your cutout should theoretically be BJD corrected, but you uncorrect both of them. Why is that?
Which one you choose (BJD or uncorrected for each) changes your matching central 20-sec cadence by ~8 cadences (160s). So in previous sectors you might be off by 1 short cadence one way or the other, but now if you choose the wrong one, you're effectively shifting your quality flags to the wrong 200-sec cadence.
I tried playing around with it and just confused myself more, but I chose to use the BJD corrected times for the quality flag match for now.
This is my fix for #261.
Upon reflection, I decided the easiest approach would be to switch to using the 20-sec targets as the reference point because then you again have an integer 10 20-sec cadences making up the new 200-sec FFI cadence.
I believe I made all the necessary changes, and it builds locally and seems to work on a test TOI.
Summary of changes:
The big issue I'm having is in choosing the correct 20-s cadences to use in the CBVs/quality flags.
In both cases, you're uncorrecting the BJD correction to compare times? For some reason, that seems to be correct for the CBVs as far as I can tell (the CBV times do seem to not be BJD corrected).
But in the quality flag section, both the target and your cutout should theoretically be BJD corrected, but you uncorrect both of them. Why is that?
Which one you choose (BJD or uncorrected for each) changes your matching central 20-sec cadence by ~8 cadences (160s). So in previous sectors you might be off by 1 short cadence one way or the other, but now if you choose the wrong one, you're effectively shifting your quality flags to the wrong 200-sec cadence.
I tried playing around with it and just confused myself more, but I chose to use the BJD corrected times for the quality flag match for now.