@@ -68,82 +68,3 @@ def Pearson7(x, ampl, alpha, m, y0, x0, args=()):
6868 return ampl * h + y0
6969
7070
71- def convolveData (a , b ):
72- return np .real (np .fft .ifft (np .fft .fft (a )* np .fft .fft (b )))
73-
74- #1 component expontential distribution:
75- def ExpDecay_1 (x , ampl1 , tau1 , y0 , x0 , args = ()):
76- h = np .zeros (x .size )
77- lengthVec = len (args )
78-
79- shift_1 = np .remainder (np .remainder (x - np .floor (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
80- shift_Incr1 = (1 - x0 + np .floor (x0 ))* args [shift_1 .astype (int )]
81-
82- shift_2 = np .remainder (np .remainder (x - np .ceil (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
83- shift_Incr2 = (x0 - np .floor (x0 ))* args [shift_2 .astype (int )]
84-
85- irf_shifted = (shift_Incr1 + shift_Incr2 )
86- irf_norm = irf_shifted / sum (irf_shifted )
87-
88- h = ampl1 * np .exp (- (x )/ tau1 )
89- hConvIrf_norm = convolveData (h , irf_norm ) + y0
90- return hConvIrf_norm
91-
92- #2 component expontential distribution:
93- def ExpDecay_2 (x , ampl1 , tau1 , ampl2 , tau2 , y0 , x0 , args = ()):
94- h = np .zeros (x .size )
95- lengthVec = len (x )
96-
97- shift_1 = np .remainder (np .remainder (x - np .floor (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
98- shift_Incr1 = (1 - x0 + np .floor (x0 ))* args [shift_1 .astype (int )]
99-
100- shift_2 = np .remainder (np .remainder (x - np .ceil (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
101- shift_Incr2 = (x0 - np .floor (x0 ))* args [shift_2 .astype (int )]
102-
103- irf_shifted = (shift_Incr1 + shift_Incr2 )
104- irf_norm = irf_shifted / sum (irf_shifted )
105-
106- h = ampl1 * np .exp (- (x )/ tau1 ) + ampl2 * np .exp (- (x )/ tau2 )
107- hConvIrf_norm = convolveData (h , irf_norm ) + y0
108- return hConvIrf_norm
109-
110- #3 component expontential distribution:
111- def ExpDecay_3 (x , ampl1 , tau1 , ampl2 , tau2 , ampl3 , tau3 , y0 , x0 , args = ()):
112- h = np .zeros (x .size )
113- lengthVec = len (args )
114-
115- shift_1 = np .remainder (np .remainder (x - np .floor (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
116- shift_Incr1 = (1 - x0 + np .floor (x0 ))* args [shift_1 .astype (int )]
117-
118- shift_2 = np .remainder (np .remainder (x - np .ceil (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
119- shift_Incr2 = (x0 - np .floor (x0 ))* args [shift_2 .astype (int )]
120-
121- irf_shifted = (shift_Incr1 + shift_Incr2 )
122- irf_norm = irf_shifted / sum (irf_shifted )
123-
124- h = ampl1 * np .exp (- (x )/ tau1 ) + ampl2 * np .exp (- (x )/ tau2 ) + ampl3 * np .exp (- (x )/ tau3 )
125- hConvIrf_norm = convolveData (h , irf_norm ) + y0
126- return hConvIrf_norm
127-
128- #4 component expontential distribution:
129- def ExpDecay_4 (x , ampl1 , tau1 , ampl2 , tau2 , ampl3 , tau3 , ampl4 , tau4 , y0 , x0 , args = ()):
130- h = np .zeros (x .size )
131- lengthVec = len (args )
132-
133- shift_1 = np .remainder (np .remainder (x - np .floor (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
134- shift_Incr1 = (1 - x0 + np .floor (x0 ))* args [shift_1 .astype (int )]
135-
136- shift_2 = np .remainder (np .remainder (x - np .ceil (x0 )- 1 , lengthVec ) + lengthVec , lengthVec )
137- shift_Incr2 = (x0 - np .floor (x0 ))* args [shift_2 .astype (int )]
138-
139- irf_shifted = (shift_Incr1 + shift_Incr2 )
140- irf_norm = irf_shifted / sum (irf_shifted )
141-
142- h = ampl1 * np .exp (- (x )/ tau1 ) + ampl2 * np .exp (- (x )/ tau2 ) + ampl3 * np .exp (- (x )/ tau3 ) + ampl4 * np .exp (- (x )/ tau4 )
143- hConvIrf_norm = convolveData (h , irf_norm ) + y0
144- return hConvIrf_norm
145-
146-
147-
148-
149-
0 commit comments