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 = []
|
peaks = []
|
||||||
fits = []
|
fits = []
|
||||||
for index in maxIndices:
|
for index in maxIndices:
|
||||||
|
try:
|
||||||
Peak, flareFitDataPoints, fit = calculateFitForFlare(lightcurve, index)
|
Peak, flareFitDataPoints, fit = calculateFitForFlare(lightcurve, index)
|
||||||
peaks.append({"FlarePeak": Peak,
|
peaks.append({"FlarePeak": Peak,
|
||||||
"FlarePeakTime": lightcurve.time[index],
|
"FlarePeakTime": lightcurve.time[index],
|
||||||
@@ -37,6 +38,8 @@ def calculateFlareFitsForLightcurve(lightcurve, num=100, distance=1, height=0.05
|
|||||||
fits.append({"FlareFit": fit,
|
fits.append({"FlareFit": fit,
|
||||||
"FlareFitTime": lightcurve.time[flareFitDataPoints],
|
"FlareFitTime": lightcurve.time[flareFitDataPoints],
|
||||||
"StandardIndex": flareFitDataPoints})
|
"StandardIndex": flareFitDataPoints})
|
||||||
|
except Exception as error:
|
||||||
|
print("Flare fit exception: ", error)
|
||||||
|
|
||||||
return peaks, fits
|
return peaks, fits
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user