From cd33dfbe29cf05f077367fece8f2581836c31da5 Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Tue, 19 Mar 2024 12:36:48 +0100 Subject: [PATCH] astrodatagui: FlaredetectorWidget: add option to plot multiple fits files at once --- main/astrodatagui/ui/FlaredetectorWidget.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/main/astrodatagui/ui/FlaredetectorWidget.py b/main/astrodatagui/ui/FlaredetectorWidget.py index b8782a1..aa695ed 100644 --- a/main/astrodatagui/ui/FlaredetectorWidget.py +++ b/main/astrodatagui/ui/FlaredetectorWidget.py @@ -32,6 +32,27 @@ class FlaredetectorWidget(QtWidgets.QWidget): def setFitsFile(self, fitsFilePath, mainName: str): print(f"Plotting: {fitsFilePath}") self.currentLC = lk.read(fitsFilePath) + self.currentLCCollection = None + self.currentMainName = mainName + self.updatePlot() + + def setFitsFiles(self, mainName: str, fitsFilePaths: list[str]): + print(f"Combining {len(fitsFilePaths)} fits files...") + if(len(fitsFilePaths) == 0): + print("Error, need to provide atleast 1 fits file") + return + + if(len(fitsFilePaths) == 1): + self.setFitsFile(fitsFilePaths[0], mainName) + return + + lcList = [] + for path in fitsFilePaths: + print(path) + lcList.append(lk.read(path)) + + self.currentLCCollection = lk.LightCurveCollection(lcList) + self.currentLC = self.currentLCCollection.stitch() self.currentMainName = mainName self.updatePlot()