astrodatagui: FlaredetectorWidget: use proper flux to fit

This commit is contained in:
2024-04-24 11:16:51 +02:00
parent 4a09d3a757
commit a15e771845
+6 -6
View File
@@ -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"])