From 003a821789cd91133f3a2c9ded274a20dc2b3d58 Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Mon, 18 Mar 2024 15:32:41 +0100 Subject: [PATCH] astrodatagui: FlaredetectorWidget: set up setFluxType function --- main/astrodatagui/ui/FlaredetectorWidget.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/astrodatagui/ui/FlaredetectorWidget.py b/main/astrodatagui/ui/FlaredetectorWidget.py index c03738a..f29d090 100644 --- a/main/astrodatagui/ui/FlaredetectorWidget.py +++ b/main/astrodatagui/ui/FlaredetectorWidget.py @@ -35,6 +35,13 @@ class FlaredetectorWidget(QtWidgets.QWidget): self.currentMainName = mainName 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): self.NormalizeState["Enabled"] = enabled if(scale not in ["unscaled", "percent", "ppt", "ppm"]): @@ -107,6 +114,7 @@ class FlaredetectorWidget(QtWidgets.QWidget): def updatePlot(self): lc = self.currentLC label = f"{self.currentMainName}" + lc.flux = lc[self.fluxType] if(self.NormalizeState["Enabled"]): lc = lc.normalize(unit=self.NormalizeState["Scale"]) label += " - normalized"