From 5bdc15210e7dcb6e9c244a5bbfa80843dfbd6a9f Mon Sep 17 00:00:00 2001 From: "a.ott" Date: Tue, 14 Jul 2020 17:28:53 +0200 Subject: [PATCH] add functions for single and double gauss curves --- functions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/functions.py b/functions.py index e1c821b..8d189cc 100644 --- a/functions.py +++ b/functions.py @@ -50,6 +50,14 @@ def inverse_full_boltzmann(x, f_max, f_min, k, x_zero): return -(np.log((f_max-f_min) / (x - f_min) - 1) / k) + x_zero +def gauss(x, a, x0, sigma): + return a*np.e**(-(x-x0)**2/(2*sigma**2)) + + +def two_gauss(x, a_1, x0_1, sigma_1, a_2, x0_2, sigma_2): + return a_1 * np.e ** (-(x - x0_1) ** 2 / (2 * sigma_1 ** 2)) + a_2 * np.e ** (-(x - x0_2) ** 2 / (2 * sigma_2 ** 2)) + + @jit(nopython=True) # useful in less that 1000x10000 calls (1000 tests with 10k data points) def rectify(x): if x < 0: