From 277a1eb4737792048149b0ae3357c53880d62f85 Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Mon, 13 May 2024 11:33:10 +0200 Subject: [PATCH] flaredetector: dont check pcov --- main/flaredetector/flaredetector.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main/flaredetector/flaredetector.py b/main/flaredetector/flaredetector.py index 22a1ee2..219ee71 100644 --- a/main/flaredetector/flaredetector.py +++ b/main/flaredetector/flaredetector.py @@ -33,15 +33,10 @@ def calculateFitForFlare(lightcurve, peakIndex): if(not isValidFlarePoint(flareData, newPeakIndex)): raise Exception("Flare not valid: not enough datapoints above mean") if(PeakMinus1 > 0.01 and PeakMinus1 < PeakMinus2): - if(Peak > 0.025): - print(lightcurve.time[peakIndex], lightcurve.flux[peakIndex]) - print(lightcurve.flux[peakIndex], lightcurve.flux[peakIndex-1], lightcurve.flux[peakIndex-2]) raise Exception(f"Flare not valid: peak-2 > peak-1, {PeakMinus2} > {PeakMinus1}") # TODO: allow peak-1 to be around/lower than mean too if theres enough points after popt, pcov = curve_fit(lambda x, l, w: GaussExpo(x, Peak, l, w), flareFitDataPoints, flareData) pcovDiag = np.diag(pcov) - if(pcovDiag[0] > 1 and pcovDiag[1] > 1): - raise Exception("Flare not valid: could not properly fit") fit = GaussExpo(flareFitDataPoints, Peak, *popt) flareFitDataPoints = flareFitDataPoints + peakIndex return Peak+1, flareFitDataPoints, fit+1