add functions for single and double gauss curves

This commit is contained in:
a.ott 2020-07-14 17:28:53 +02:00
parent a9fe4b4149
commit 5bdc15210e

View File

@ -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: