In [1]:
%pylab inline
This notebook shows the basic usage of the CBVshrink routines.
This is how you'd compute the CBVshrink correction for a single quarter of Kepler long-cadence data. The example we are using here is the Q6 light curve for Kepler-405, which has two transiting planet candidates, one of which has been confirmed by TTVs.
In [2]:
from cbvshrink import cbv
cbv.correct_file('kplr009579641-2010174085026_llc.fits',\
'kplr2010174085026-q05-d25_lcbv.fits',\
'kplr009579641-2010174085026_llc_cbvshrink.fits',\
doplot=True)
The figure above shows, in the top panel, the SAP light curve in black, and below it (with an arbitrary vertical offset for clarity), different versions of the correction. First, the green curve shows the PDC-msMAP correction, for reference. Then in different shades of red to blue we see the correction obtained with CBVshrink using 1, then 2, then 3, ..., then 8 CBVs (the PDC pipeline computes 16 CBVs but never uses more than 8, and we don't recommend doing it either). In the bottom panel are shown the light curves after correction, again using the same colour-coding.
The above function call used the LC file and the CBV file for the relevant quarter as inputs, and produced an output file which is a copy of the original with additional columns added storing the corrected LC using 1, then 2, ..., then 8 CBVs. The output file also has new header keywords storing the weights of the CBVs and the CDPP estimates for the corrected LC, in each case.
Despite the care devoted to avoiding over-fitting, the results depend very slightly on the number of CBVs used. In general, since the CBVs are noisy, you should use the smallest number of CBVs that appears to do a reasonable job, to minimise the noise injected into the corrected light curve. The optimal number to use really depends on the individual light curve, so right now we do not make the decision ourselves, we leave it to the user.
In the example above, the correction essentially doesn't change after 3 CBVs, so 3 is probably the right number to use. As is the case for most light curves, the corrected LC one ends up with is extremely similar to the PDC-msMAP version. In a small but signficant minority of cases, however, the CBVshrink correction is "better" than the PDC-msMAP, specifically it introduces less high-frequency noise and preserves stellar variability better.
We are working on a "recipe" for automatically selecting the number of CBVs, we have one that worked pretty well on earlier versions of Kepler data, but we haven't fully tested it on the (final) data release 25. As soon as we have done that, we will update the code to include an option to select the number of CBVs used automatically.
In [ ]: