astrodatagui: FlaredectorWidget: set proper normalization for collections

This commit is contained in:
2024-03-20 14:36:33 +01:00
parent 966901f427
commit c47cdf56be
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -190,7 +190,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
self.flaredetectorPreview.setFitsFile(filePath, mainName)
def btCombineSeqClicked(self):
self.gbPlotOptionsNormalize.setEnabled(False)
#self.gbPlotOptionsNormalize.setEnabled(False)
mainName = self.listDownloaded.currentItem().text()
filePaths = []
for item in self.listSequences.selectedItems():
+10 -1
View File
@@ -146,13 +146,22 @@ class FlaredetectorWidget(QtWidgets.QWidget):
self.FlattenState["Enabled"] = False
self.updatePlot()
def normalizeStichedLightCurve(self, lc):
print(lc, self.NormalizeState["Scale"])
return lc.normalize(unit=self.NormalizeState["Scale"])
def updatePlot(self):
lc = self.currentLC
label = f"{self.currentMainName}"
lc.flux = lc[self.fluxType]
if(self.NormalizeState["Enabled"]):
if(self.currentLCCollection is None):
print("normalizing normal lc")
lc = lc.normalize(unit=self.NormalizeState["Scale"])
else:
print("normalizing collection")
lc = self.currentLCCollection.stitch(self.normalizeStichedLightCurve)
label += " - normalized"
lc.flux = lc[self.fluxType]
if(self.RemoveOutliersState["Enabled"]):
lc = lc.remove_outliers(sigma=self.RemoveOutliersState["Sigma"])
label += " - no ol"