astrodatagui: FlaredectorWidget: set proper normalization for collections
This commit is contained in:
@@ -190,7 +190,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
self.flaredetectorPreview.setFitsFile(filePath, mainName)
|
self.flaredetectorPreview.setFitsFile(filePath, mainName)
|
||||||
|
|
||||||
def btCombineSeqClicked(self):
|
def btCombineSeqClicked(self):
|
||||||
self.gbPlotOptionsNormalize.setEnabled(False)
|
#self.gbPlotOptionsNormalize.setEnabled(False)
|
||||||
mainName = self.listDownloaded.currentItem().text()
|
mainName = self.listDownloaded.currentItem().text()
|
||||||
filePaths = []
|
filePaths = []
|
||||||
for item in self.listSequences.selectedItems():
|
for item in self.listSequences.selectedItems():
|
||||||
|
|||||||
@@ -146,13 +146,22 @@ class FlaredetectorWidget(QtWidgets.QWidget):
|
|||||||
self.FlattenState["Enabled"] = False
|
self.FlattenState["Enabled"] = False
|
||||||
self.updatePlot()
|
self.updatePlot()
|
||||||
|
|
||||||
|
def normalizeStichedLightCurve(self, lc):
|
||||||
|
print(lc, self.NormalizeState["Scale"])
|
||||||
|
return lc.normalize(unit=self.NormalizeState["Scale"])
|
||||||
|
|
||||||
def updatePlot(self):
|
def updatePlot(self):
|
||||||
lc = self.currentLC
|
lc = self.currentLC
|
||||||
label = f"{self.currentMainName}"
|
label = f"{self.currentMainName}"
|
||||||
lc.flux = lc[self.fluxType]
|
|
||||||
if(self.NormalizeState["Enabled"]):
|
if(self.NormalizeState["Enabled"]):
|
||||||
|
if(self.currentLCCollection is None):
|
||||||
|
print("normalizing normal lc")
|
||||||
lc = lc.normalize(unit=self.NormalizeState["Scale"])
|
lc = lc.normalize(unit=self.NormalizeState["Scale"])
|
||||||
|
else:
|
||||||
|
print("normalizing collection")
|
||||||
|
lc = self.currentLCCollection.stitch(self.normalizeStichedLightCurve)
|
||||||
label += " - normalized"
|
label += " - normalized"
|
||||||
|
lc.flux = lc[self.fluxType]
|
||||||
if(self.RemoveOutliersState["Enabled"]):
|
if(self.RemoveOutliersState["Enabled"]):
|
||||||
lc = lc.remove_outliers(sigma=self.RemoveOutliersState["Sigma"])
|
lc = lc.remove_outliers(sigma=self.RemoveOutliersState["Sigma"])
|
||||||
label += " - no ol"
|
label += " - no ol"
|
||||||
|
|||||||
Reference in New Issue
Block a user