From 1ecacfcaa4c7b5be43c3429c6a4d956ed7b6e84f Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Mon, 15 Apr 2024 14:32:40 +0200 Subject: [PATCH] flaredetector: add GaussExponential function to fit flares --- main/flaredetector/flaredetector.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/flaredetector/flaredetector.py b/main/flaredetector/flaredetector.py index 8b13789..9c17a12 100644 --- a/main/flaredetector/flaredetector.py +++ b/main/flaredetector/flaredetector.py @@ -1 +1,9 @@ +import numpy as np +def GaussExpo(x, Peak, l, w): + sigma = 1/w + res1 = Peak * np.exp(-(x**2)/(2 * sigma**2)) + peakX = np.argmax(res1) + res1 = res1[:peakX] + res2 = Peak * np.exp(-l * x[peakX:]) + return np.append(res1, res2)