Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def roll_correction(lc, x_point, y_point):
# lc, x_point, y_point = load_data(camera, chip)
time = np.arange(0,len(lc),1)
sff = SFFCorrector()
lc_corrected = sff.correct(time, lc, x_point, y_point, niters=1,
windows=1, polyorder=5)
return lc_corrected.flux
def rotation_corr(lc, x_pos, y_pos):
""" Corrects for spacecraft roll using Lightkurve """
time = np.arange(0, len(lc), 1)
sff = SFFCorrector()
x_pos, y_pos = np.array(x_pos), np.array(y_pos)
lc_corrected = sff.correct(time, lc, x_pos, y_pos, niters=1,
windows=1, polyorder=5)
return lc_corrected.flux
def rotation_corr(lc, x_pos, y_pos):
""" Corrects for spacecraft roll using Lightkurve """
time = np.arange(0, len(lc), 1)
sff = SFFCorrector()
x_pos, y_pos = np.array(x_pos), np.array(y_pos)
lc_corrected = sff.correct(time, lc, x_pos, y_pos, niters=1,
windows=1, polyorder=5)
return lc_corrected.flux
pointing model.
Parameters
----------
flux : numpy.ndarray
Flux array to which detrending applied.
"""
brk = self.find_break()
r1 = np.arange(0, brk, 1)
r2 = np.arange(brk,len(self.time))
t1 = self.time[r1]; f1 = flux[r1]
t2 = self.time[r2]; f2 = flux[r2]
sff = SFFCorrector()
corr_lc_obj_1 = sff.correct(time=t1, flux=f1,
centroid_col=self.centroid_xs[r1],
centroid_row=self.centroid_ys[r1],
windows=1, polyorder=2, niters=3, sigma_1=3, sigma_2=5,
restore_trend=True, bins=15)
corr_lc_obj_2 = sff.correct(time=t2, flux=f2,
centroid_col=self.centroid_xs[r2],
centroid_row=self.centroid_ys[r2],
windows=1, polyorder=2, niters=3, sigma_1=3, sigma_2=5,
restore_trend=True, bins=15)
return np.append(corr_lc_obj_1.flux, corr_lc_obj_2.flux)