I've been considering a consistent way to plot the final transits, and I think I've found a robust way to do it. The best procedure I think would be:
Set a wide window when using split_lightcurve, around 8, which seems to work well enough for most of the planets.
For the final lightcurves we employ a filter/mask, based upon the fitted model to find exactly where the transits are.
Currently the code I have implemented reads in the fitted_lc's and performs this via:
# First take the fitted flux and figure out where the dip in the lc is and return a bool mask
transit_mask = np.ma.masked_values(fity, 1.).mask
# Next find the indices where this happens
transit_loc = np.where(transit_mask==False)
# Create a fixed window either side which is 50% of the t14
window = int(len(transit_loc[0]) * 0.5)
start, stop = transit_loc[0][0] - window, transit_loc[0][-1] + window
# Apply the extended window
transit_mask[start:stop] = False
# Apply the masks
time = time[~transit_mask]
flux = flux[~transit_mask]
flux_err = flux_err[~transit_mask]
fitx = fitx[~transit_mask]
fity = fity[~transit_mask]
With this method we could effectively make the window wide enough to capture all planet transits to fit them, and then trim off the extra data before plotting. Instead of a window based on distance from t0, this is a window based upon the fitted transit duration and would guarantee every plot has the same ratio of transit to baseline.
I also guess this could be a way of estimating tdv from each fitted lc?
I've been considering a consistent way to plot the final transits, and I think I've found a robust way to do it. The best procedure I think would be:
Currently the code I have implemented reads in the fitted_lc's and performs this via:
With this method we could effectively make the window wide enough to capture all planet transits to fit them, and then trim off the extra data before plotting. Instead of a window based on distance from t0, this is a window based upon the fitted transit duration and would guarantee every plot has the same ratio of transit to baseline.
I also guess this could be a way of estimating tdv from each fitted lc?