flaredetector: catch exception if we cant fit the flare

This commit is contained in:
2024-04-17 09:33:21 +02:00
parent 126195fdb3
commit f19dba985c
+3
View File
@@ -30,6 +30,7 @@ def calculateFlareFitsForLightcurve(lightcurve, num=100, distance=1, height=0.05
peaks = []
fits = []
for index in maxIndices:
try:
Peak, flareFitDataPoints, fit = calculateFitForFlare(lightcurve, index)
peaks.append({"FlarePeak": Peak,
"FlarePeakTime": lightcurve.time[index],
@@ -37,6 +38,8 @@ def calculateFlareFitsForLightcurve(lightcurve, num=100, distance=1, height=0.05
fits.append({"FlareFit": fit,
"FlareFitTime": lightcurve.time[flareFitDataPoints],
"StandardIndex": flareFitDataPoints})
except Exception as error:
print("Flare fit exception: ", error)
return peaks, fits