42
42
43
43
__license__ = "MIT"
44
44
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
45
- __date__ = "02/12/2021 "
45
+ __date__ = "03/ 02/2022 "
46
46
__status__ = "status"
47
47
48
48
import os
@@ -118,7 +118,7 @@ def parse():
118
118
help = "Output filename" )
119
119
group .add_argument ("--save-source" , action = 'store_true' , dest = "save_source" , default = False ,
120
120
help = "save the path for all source files" )
121
-
121
+
122
122
group = parser .add_argument_group ("Scan options" )
123
123
group .add_argument ("--grid-size" , nargs = 2 , type = int , dest = "grid_size" , default = None ,
124
124
help = "Grid along which the data was acquired" )
@@ -154,35 +154,35 @@ def parse():
154
154
group .add_argument ("-m" , "--mask" , type = str , default = None ,
155
155
help = "mask to be used for invalid pixels" )
156
156
group .add_argument ("--dummy" , type = float , default = None ,
157
- help = "value of dynamically masked pixels" )
157
+ help = "value of dynamically masked pixels (disabled by default) " )
158
158
group .add_argument ("--delta-dummy" , type = float , default = None ,
159
159
help = "precision for dummy value" )
160
160
group .add_argument ("--radial-range" , dest = "radial_range" , nargs = 2 , type = float , default = None ,
161
- help = "radial range as a 2-tuple of number of pixels, by default all available range" )
161
+ help = "radial range as a 2-tuple of number of pixels ( all available range by default) " )
162
162
group .add_argument ("-P" , "--polarization" , type = float , default = None ,
163
- help = "Polarization factor of the incident beam [-1:1], by default disabled , 0.99 is a good guess" )
163
+ help = "Polarization factor of the incident beam [-1:1] (off by default, 0.99 is a good guess on synchrotrons " )
164
164
group .add_argument ("-A" , "--solidangle" , action = 'store_true' , default = None ,
165
165
help = "Correct for solid-angle correction (important if the detector is not mounted normally to the incident beam, off by default" )
166
166
group = parser .add_argument_group ("Sigma-clipping options" )
167
167
group .add_argument ("--bins" , type = int , default = 1000 ,
168
- help = "Number of radial bins to consider" )
168
+ help = "Number of radial bins to consider (1000 by default) " )
169
169
group .add_argument ("--unit" , type = str , default = "r_m" ,
170
- help = "radial unit to perform the calculation" )
170
+ help = "radial unit to perform the calculation (r_m by default) " )
171
171
group .add_argument ("--cycle" , type = int , default = 5 ,
172
- help = "precision for dummy value " )
172
+ help = "Number of cycles for the sigma-clipping (5 by default) " )
173
173
group .add_argument ("--cutoff-clip" , dest = "cutoff_clip" , type = float , default = 0.0 ,
174
- help = "SNR threshold for considering a pixel outlier when performing the sigma-clipping" )
174
+ help = "SNR threshold for considering a pixel outlier when performing the sigma-clipping (0 by default: fallback on Chauvenet criterion) " )
175
175
group .add_argument ("--error-model" , dest = "error_model" , type = str , default = "poisson" ,
176
176
help = "Statistical model for the signal error, may be `poisson`(default) or `azimuthal` (slower) or even a simple formula like '5*I+8'" )
177
177
group = parser .add_argument_group ("Peak finding options" )
178
178
group .add_argument ("--cutoff-pick" , dest = "cutoff_pick" , type = float , default = 3.0 ,
179
- help = "SNR threshold for considering a pixel high when searching for peaks" )
179
+ help = "SNR threshold for considering a pixel high when searching for peaks (3 by default) " )
180
180
group .add_argument ("--noise" , type = float , default = 1.0 ,
181
- help = "Quadratically added noise to the background" )
181
+ help = "Quadratically added noise to the background (1 by default " )
182
182
group .add_argument ("--patch-size" , type = int , default = 5 ,
183
- help = "size of the neighborhood for integration" )
183
+ help = "size of the neighborhood for integration (5 by default) " )
184
184
group .add_argument ("--connected" , type = int , default = 3 ,
185
- help = "Number of high pixels in neighborhood to be considered as a peak" )
185
+ help = "Number of high pixels in neighborhood to be considered as a peak (3 by default) " )
186
186
group = parser .add_argument_group ("Opencl setup options" )
187
187
group .add_argument ("--workgroup" , type = int , default = None ,
188
188
help = "Enforce the workgroup size for OpenCL kernel. Impacts only on the execution speed, not on the result." )
@@ -295,7 +295,7 @@ def process(options):
295
295
("noise" , options .noise ),
296
296
("cutoff_pick" , options .cutoff_pick ),
297
297
("radial_range" , rrange ),
298
- ('patch_size' , options .patch_size ),
298
+ ('patch_size' , options .patch_size ),
299
299
("connected" , options .connected )])
300
300
if options .solidangle :
301
301
parameters ["solidangle" ], parameters ["solidangle_checksum" ] = ai .solidAngleArray (with_checksum = True )
@@ -335,14 +335,14 @@ def process(options):
335
335
parameters ["correctSolidAngle" ] = True
336
336
if options .mask is not None :
337
337
parameters ["mask" ] = True
338
-
338
+
339
339
save_spots (options .output ,
340
340
frames ,
341
341
beamline = options .beamline ,
342
342
ai = ai ,
343
343
source = options .images if options .save_source else None ,
344
344
extra = parameters ,
345
- grid = (options .grid_size , options .zig_zag ))
345
+ grid = (options .grid_size , options .zig_zag ))
346
346
347
347
if options .profile :
348
348
try :
@@ -351,7 +351,7 @@ def process(options):
351
351
pf .log_profile ()
352
352
if pb :
353
353
pb .clear ()
354
- logger .info (f"Total peakfinder time: %.3fs \t (%.3f fps)" , t1 - t0 , cnt / (t1 - t0 ))
354
+ logger .info (f"Total peakfinder time: %.3fs \t (%.3f fps)" , t1 - t0 , cnt / (t1 - t0 ))
355
355
356
356
return EXIT_SUCCESS
357
357
0 commit comments