diff --git a/main/astrodatagui/ui/FlaredetectorWidget.py b/main/astrodatagui/ui/FlaredetectorWidget.py index f37001a..3494d5b 100644 --- a/main/astrodatagui/ui/FlaredetectorWidget.py +++ b/main/astrodatagui/ui/FlaredetectorWidget.py @@ -170,8 +170,11 @@ class FlaredetectorWidget(QtWidgets.QWidget): return lc.normalize(unit=self.NormalizeState["Scale"]) def updateFit(self): - self.peaks, self.fits = calculateFlareFitsForLightcurve(self.currentLC.flatten(window_length=self.FlattenState["WindowLength"], - polyorder=self.FlattenState["PolynomialOrder"]), num=100) + lc = self.currentLC + lc.flux = lc[self.fluxType] + self.currentFlattenLC = lc.flatten(window_length=self.FlattenState["WindowLength"], + polyorder=self.FlattenState["PolynomialOrder"]) + self.peaks, self.fits = calculateFlareFitsForLightcurve(self.currentFlattenLC, num=100) def updatePlot(self): lc = self.currentLC @@ -196,11 +199,8 @@ class FlaredetectorWidget(QtWidgets.QWidget): lc = lc.bin(time_bin_size=self.BinState["Size"]) label += " - binned" if(self.FlattenState["Enabled"]): - lc = lc.flatten(window_length=self.FlattenState["WindowLength"], - polyorder=self.FlattenState["PolynomialOrder"]) + lc = self.currentFlattenLC label += " - flattened" - - #maxPowers = findMaxIndices(lc, 100, height=1.005, distance=1) if(self.FoldState["Enabled"]): lc = lc.fold(period=self.FoldState["Period"], epoch_time=self.FoldState["EpochTime"])