astrodatagui: abort if wl/po/period/epoch arent valid ints/floats
This commit is contained in:
@@ -295,14 +295,22 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
def updateFlaredetectionWidgetFlatten(self):
|
def updateFlaredetectionWidgetFlatten(self):
|
||||||
flattenEnabled = self.cbPlotFlattenPlotEnable.isChecked()
|
flattenEnabled = self.cbPlotFlattenPlotEnable.isChecked()
|
||||||
windowLength = int(self.edPlotFlattenWL.text())
|
try:
|
||||||
po = int(self.edPlotFlattenPO.text())
|
windowLength = int(self.edPlotFlattenWL.text())
|
||||||
|
po = int(self.edPlotFlattenPO.text())
|
||||||
|
except:
|
||||||
|
print(f"Invalid WL/PO detected, aborting")
|
||||||
|
return
|
||||||
self.flaredetectorPreview.setFlattenState(flattenEnabled, windowLength, po)
|
self.flaredetectorPreview.setFlattenState(flattenEnabled, windowLength, po)
|
||||||
|
|
||||||
def updateFlaredetectionWidgetFold(self):
|
def updateFlaredetectionWidgetFold(self):
|
||||||
foldEnabled = self.cbPlotFoldEnable.isChecked()
|
foldEnabled = self.cbPlotFoldEnable.isChecked()
|
||||||
period = float(self.edPlotFoldPeriod.text())
|
try:
|
||||||
epoch = float(self.edPlotFoldEpochTime.text())
|
period = float(self.edPlotFoldPeriod.text())
|
||||||
|
epoch = float(self.edPlotFoldEpochTime.text())
|
||||||
|
except:
|
||||||
|
print(f"Invalid period/epoch detected, aborting")
|
||||||
|
return
|
||||||
self.flaredetectorPreview.setFoldState(foldEnabled, period, epoch)
|
self.flaredetectorPreview.setFoldState(foldEnabled, period, epoch)
|
||||||
|
|
||||||
def updateFlaredetectionWidgetPeriodogram(self):
|
def updateFlaredetectionWidgetPeriodogram(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user