Last active
August 8, 2019 15:21
-
-
Save DomiDre/adabee37ddd4846fc27d7da2954bae36 to your computer and use it in GitHub Desktop.
A quick generation of a Gaussian data with small noise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
x = np.linspace(0, 10, 51) | |
A = 42 | |
mu = 4.2 | |
sigma = 0.666 | |
c = 10 | |
sig_y = 3*np.ones(len(x)) #np.sqrt(y) | |
y = np.round( | |
np.random.normal(A * np.exp(-0.5*((x-mu)/sigma)**2) + c, sig_y) | |
) | |
np.savetxt('gaussianData.xye', np.c_[x, y, sig_y], | |
header='x\ty\tsy', | |
delimiter='\t', | |
fmt='%10.5f' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment