flaredetector: catch exception if we cant fit the flare
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user