astrodatagui: FlaredetectorWidget: add option to plot multiple fits files at once
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user