@@ -289,7 +289,7 @@ def rectangular(N, spacing, *, center=[0, 0, 0], orientation=[1, 0, 0]):
289
289
return SecondarySourceDistribution (positions , normals , weights )
290
290
291
291
292
- def rounded_edge (Nxy , Nr , dx , * , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
292
+ def rounded_edge (Nxy , Nr , spacing , * , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
293
293
"""Return SSD along the xy-axis with rounded edge at the origin.
294
294
295
295
Parameters
@@ -299,6 +299,8 @@ def rounded_edge(Nxy, Nr, dx, *, center=[0, 0, 0], orientation=[1, 0, 0]):
299
299
Nr : int
300
300
Number of secondary sources in rounded edge. Radius of edge is
301
301
adjusted to equdistant sampling along entire array.
302
+ spacing : float
303
+ Distance (in metres) between secondary sources.
302
304
center : (3,) array_like, optional
303
305
Position of edge.
304
306
orientation : (3,) array_like, optional
@@ -323,10 +325,11 @@ def rounded_edge(Nxy, Nr, dx, *, center=[0, 0, 0], orientation=[1, 0, 0]):
323
325
"""
324
326
# radius of rounded edge
325
327
Nr += 1
326
- R = 2 / _np .pi * Nr * dx
328
+ R = 2 / _np .pi * Nr * spacing
327
329
328
330
# array along y-axis
329
- x00 , n00 , a00 = linear (Nxy , dx , center = [0 , Nxy // 2 * dx + dx / 2 + R , 0 ])
331
+ x00 , n00 , a00 = linear (Nxy , spacing ,
332
+ center = [0 , Nxy // 2 * spacing + spacing / 2 + R , 0 ])
330
333
x00 = _np .flipud (x00 )
331
334
positions = x00
332
335
directions = n00
@@ -342,13 +345,14 @@ def rounded_edge(Nxy, Nr, dx, *, center=[0, 0, 0], orientation=[1, 0, 0]):
342
345
x00 [n , 1 ] = R * (1 - _np .sin (alpha ))
343
346
n00 [n , 0 ] = _np .cos (alpha )
344
347
n00 [n , 1 ] = _np .sin (alpha )
345
- a00 [n ] = dx
348
+ a00 [n ] = spacing
346
349
positions = _np .concatenate ((positions , x00 ))
347
350
directions = _np .concatenate ((directions , n00 ))
348
351
weights = _np .concatenate ((weights , a00 ))
349
352
350
353
# array along x-axis
351
- x00 , n00 , a00 = linear (Nxy , dx , center = [Nxy // 2 * dx - dx / 2 + R , 0 , 0 ],
354
+ x00 , n00 , a00 = linear (Nxy , spacing ,
355
+ center = [Nxy // 2 * spacing - spacing / 2 + R , 0 , 0 ],
352
356
orientation = [0 , 1 , 0 ])
353
357
x00 = _np .flipud (x00 )
354
358
positions = _np .concatenate ((positions , x00 ))
@@ -363,13 +367,15 @@ def rounded_edge(Nxy, Nr, dx, *, center=[0, 0, 0], orientation=[1, 0, 0]):
363
367
return SecondarySourceDistribution (positions , directions , weights )
364
368
365
369
366
- def edge (Nxy , dx , * , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
370
+ def edge (Nxy , spacing , * , center = [0 , 0 , 0 ], orientation = [1 , 0 , 0 ]):
367
371
"""Return SSD along the xy-axis with sharp edge at the origin.
368
372
369
373
Parameters
370
374
----------
371
375
Nxy : int
372
376
Number of secondary sources along x- and y-axis.
377
+ spacing : float
378
+ Distance (in metres) between secondary sources.
373
379
center : (3,) array_like, optional
374
380
Position of edge.
375
381
orientation : (3,) array_like, optional
@@ -393,14 +399,16 @@ def edge(Nxy, dx, *, center=[0, 0, 0], orientation=[1, 0, 0]):
393
399
394
400
"""
395
401
# array along y-axis
396
- x00 , n00 , a00 = linear (Nxy , dx , center = [0 , Nxy // 2 * dx + dx / 2 , 0 ])
402
+ x00 , n00 , a00 = linear (Nxy , spacing ,
403
+ center = [0 , Nxy // 2 * spacing + spacing / 2 , 0 ])
397
404
x00 = _np .flipud (x00 )
398
405
positions = x00
399
406
directions = n00
400
407
weights = a00
401
408
402
409
# array along x-axis
403
- x00 , n00 , a00 = linear (Nxy , dx , center = [Nxy // 2 * dx - dx / 2 , 0 , 0 ],
410
+ x00 , n00 , a00 = linear (Nxy , spacing ,
411
+ center = [Nxy // 2 * spacing - spacing / 2 , 0 , 0 ],
404
412
orientation = [0 , 1 , 0 ])
405
413
x00 = _np .flipud (x00 )
406
414
positions = _np .concatenate ((positions , x00 ))
0 commit comments