astrodatagui: implement normalize function

This commit is contained in:
2024-03-13 09:48:44 +01:00
parent 7799836cf7
commit 956779a0a5
3 changed files with 18 additions and 5 deletions
+3 -1
View File
@@ -22,6 +22,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
self.listDownloaded.itemClicked.connect(self.starSelected)
self.listSequences.itemClicked.connect(self.sequenceSelected)
self.cbEnableNormalize.stateChanged.connect(self.plotOptionsCBChecked)
self.cbEnableFlattenPlot.stateChanged.connect(self.plotOptionsCBChecked)
self.cbEnableRemoveOutliers.stateChanged.connect(self.plotOptionsCBChecked)
self.cbEnableRemoveNans.stateChanged.connect(self.plotOptionsCBChecked)
@@ -168,6 +169,7 @@ class AstrodataGUI(QtWidgets.QMainWindow):
self.flaredetectorPreview.plotFitsFile(filePath, mainName)
def plotOptionsCBChecked(self, state):
normalize = self.cbEnableNormalize.isChecked()
flatten = self.cbEnableFlattenPlot.isChecked()
remOutliers = self.cbEnableRemoveOutliers.isChecked()
remNans = self.cbEnableRemoveNans.isChecked()
@@ -193,5 +195,5 @@ class AstrodataGUI(QtWidgets.QMainWindow):
if(binC):
binList[1] = binSize
self.flaredetectorPreview.updatePlot(flatten, remOutliers,
self.flaredetectorPreview.updatePlot(normalize, flatten, remOutliers,
remNans, foldList, binList)
+8 -1
View File
@@ -150,7 +150,7 @@
<property name="maximumSize">
<size>
<width>16777215</width>
<height>290</height>
<height>310</height>
</size>
</property>
<property name="title">
@@ -223,6 +223,13 @@
<string>Plot options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QCheckBox" name="cbEnableNormalize">
<property name="text">
<string>Normalize</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbEnableFlattenPlot">
<property name="text">
+7 -3
View File
@@ -27,12 +27,16 @@ class FlaredetectorWidget(QtWidgets.QWidget):
self.currentLC.flux = self.currentLC['sap_flux']
self.currentMainName = mainName
label = f"{mainName} - SAP Flux"
self.currentLC.plot(column="sap_flux", label=label, ax=self.figureAxis)
self.currentLC.scatter(column="sap_flux", label=label, ax=self.figureAxis)
self.figure.canvas.draw_idle()
def updatePlot(self, flatten: bool, remOutliers: bool, remNans: bool, fold: list, binList: list):
def updatePlot(self, normalize: bool, flatten: bool, remOutliers: bool,
remNans: bool, fold: list, binList: list):
lc = self.currentLC
label = f"{self.currentMainName}"
if(normalize):
lc = lc.normalize()
label += " - normalized"
if(flatten):
lc = lc.flatten()
label += " - flattened"
@@ -53,5 +57,5 @@ class FlaredetectorWidget(QtWidgets.QWidget):
label += " - binned"
self.figureAxis.clear()
lc.plot(label=label, ax=self.figureAxis)
lc.scatter(label=label, ax=self.figureAxis)
self.figure.canvas.draw_idle()