import numpy as np
import scipy.special as spsp


x = np.linspace(-1.,1.,100)

y = 0.1 - 0.3 * np.exp(-(x/0.1)**2)

z = np.zeros(x.shape) + 0.1

np.savetxt("dataset1.dat", np.stack([x,y,z], axis=-1))


y = 0.1 - 0.3 * np.exp(-(x/0.1)**2)  + 0.2 * (1. + spsp.erf(x/0.1))

z = np.zeros(x.shape) + 0.05

np.savetxt("dataset2.dat", np.stack([x,y,z], axis=-1))


tcc = 0.1
tr  = 0.5
XShift = x/tcc - (0.5*tcc/tr)

y = 0.1 - 0.3 * np.exp(-(x/tcc)**2)  + 0.2 * (1. + spsp.erf(x/tcc))  + 0.3 * np.exp(-x/tr) * (1. + spsp.erf(XShift)) * np.exp(0.25 * (tcc/tr)**2)

dz = 0.05
z = np.zeros(x.shape) + dz

np.savetxt("dataset3.dat", np.stack([x,y,z], axis=-1))

dy = np.random.uniform(low=-dz, high=+dz, size=y.shape)

np.savetxt("dataset4.dat", np.stack([x,y+dy,z], axis=-1))


XShift = -( x/tcc - (0.5*tcc/tr) )

y = 0.1 + 0.2 * (1. + spsp.erf(x/tcc))  - 0.3 * np.exp(+x/tr) * (1. + spsp.erf(XShift)) * np.exp(0.25 * (tcc/tr)**2)

np.savetxt("dataset5.dat", np.stack([x,y+dy,z], axis=-1))
