astrodatagui: FlaredetectorWidget: set up setFluxType function
This commit is contained in:
@@ -35,6 +35,13 @@ class FlaredetectorWidget(QtWidgets.QWidget):
|
|||||||
self.currentMainName = mainName
|
self.currentMainName = mainName
|
||||||
self.updatePlot()
|
self.updatePlot()
|
||||||
|
|
||||||
|
def setFluxType(self, fluxType: str):
|
||||||
|
if(fluxType not in ["sap_flux", "pdcsap_flux"]):
|
||||||
|
print(f"FluxType not supported: {fluxType}, setting default sap_flux")
|
||||||
|
fluxType = "sap_flux"
|
||||||
|
self.fluxType = fluxType
|
||||||
|
self.updatePlot()
|
||||||
|
|
||||||
def setNormalizeState(self, enabled: bool, scale: str):
|
def setNormalizeState(self, enabled: bool, scale: str):
|
||||||
self.NormalizeState["Enabled"] = enabled
|
self.NormalizeState["Enabled"] = enabled
|
||||||
if(scale not in ["unscaled", "percent", "ppt", "ppm"]):
|
if(scale not in ["unscaled", "percent", "ppt", "ppm"]):
|
||||||
@@ -107,6 +114,7 @@ class FlaredetectorWidget(QtWidgets.QWidget):
|
|||||||
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"]):
|
||||||
lc = lc.normalize(unit=self.NormalizeState["Scale"])
|
lc = lc.normalize(unit=self.NormalizeState["Scale"])
|
||||||
label += " - normalized"
|
label += " - normalized"
|
||||||
|
|||||||
Reference in New Issue
Block a user