@@ -15,19 +15,19 @@ def _top_hat(z, half_slit_width):
15
15
def _model_function (z , diameter , z0 , I0 , mud , slope ):
16
16
"""
17
17
Compute the model function with the following steps:
18
- 1. Recenter z to x by subtracting z0 ( so that the circle is centered at 0 and it is easier to compute length l)
18
+ 1. Let dz = z-z0, so that dz is centered at 0
19
19
2. Compute length l that is the effective length for computing intensity I = I0 * e^{-mu * l}:
20
- - For x within the diameter range , l is the chord length of the circle at position x
21
- - For x outside this range, l = 0
20
+ - For dz within the capillary diameter , l is the chord length of the circle at position dz
21
+ - For dz outside this range, l = 0
22
22
3. Apply a linear adjustment to I0 by taking I0 as I0 - slope * z
23
23
"""
24
24
min_radius = - diameter / 2
25
25
max_radius = diameter / 2
26
- x = z - z0
26
+ dz = z - z0
27
27
length = np .piecewise (
28
- x ,
29
- [x < min_radius , (min_radius <= x ) & (x <= max_radius ), x > max_radius ],
30
- [0 , lambda x : 2 * np .sqrt ((diameter / 2 ) ** 2 - x ** 2 ), 0 ],
28
+ dz ,
29
+ [dz < min_radius , (min_radius <= dz ) & (dz <= max_radius ), dz > max_radius ],
30
+ [0 , lambda dz : 2 * np .sqrt ((diameter / 2 ) ** 2 - dz ** 2 ), 0 ],
31
31
)
32
32
return (I0 - slope * z ) * np .exp (- mud / diameter * length )
33
33
0 commit comments