Skip to content

Commit ad52581

Browse files
committed
Update documentation of CLI tool for peakfinding
1 parent 47b2395 commit ad52581

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

pyFAI/app/peakfinder.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
__contact__ = "[email protected]"
4343
__license__ = "MIT"
4444
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
45-
__date__ = "02/12/2021"
45+
__date__ = "03/02/2022"
4646
__status__ = "status"
4747

4848
import os
@@ -118,7 +118,7 @@ def parse():
118118
help="Output filename")
119119
group.add_argument("--save-source", action='store_true', dest="save_source", default=False,
120120
help="save the path for all source files")
121-
121+
122122
group = parser.add_argument_group("Scan options")
123123
group.add_argument("--grid-size", nargs=2, type=int, dest="grid_size", default=None,
124124
help="Grid along which the data was acquired")
@@ -154,35 +154,35 @@ def parse():
154154
group.add_argument("-m", "--mask", type=str, default=None,
155155
help="mask to be used for invalid pixels")
156156
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)")
158158
group.add_argument("--delta-dummy", type=float, default=None,
159159
help="precision for dummy value")
160160
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)")
162162
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")
164164
group.add_argument("-A", "--solidangle", action='store_true', default=None,
165165
help="Correct for solid-angle correction (important if the detector is not mounted normally to the incident beam, off by default")
166166
group = parser.add_argument_group("Sigma-clipping options")
167167
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)")
169169
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)")
171171
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)")
173173
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)")
175175
group.add_argument("--error-model", dest="error_model", type=str, default="poisson",
176176
help="Statistical model for the signal error, may be `poisson`(default) or `azimuthal` (slower) or even a simple formula like '5*I+8'")
177177
group = parser.add_argument_group("Peak finding options")
178178
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)")
180180
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")
182182
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)")
184184
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)")
186186
group = parser.add_argument_group("Opencl setup options")
187187
group.add_argument("--workgroup", type=int, default=None,
188188
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):
295295
("noise", options.noise),
296296
("cutoff_pick", options.cutoff_pick),
297297
("radial_range", rrange),
298-
('patch_size', options.patch_size),
298+
('patch_size', options.patch_size),
299299
("connected", options.connected)])
300300
if options.solidangle:
301301
parameters["solidangle"], parameters["solidangle_checksum"] = ai.solidAngleArray(with_checksum=True)
@@ -335,14 +335,14 @@ def process(options):
335335
parameters["correctSolidAngle"] = True
336336
if options.mask is not None:
337337
parameters["mask"] = True
338-
338+
339339
save_spots(options.output,
340340
frames,
341341
beamline=options.beamline,
342342
ai=ai,
343343
source=options.images if options.save_source else None,
344344
extra=parameters,
345-
grid = (options.grid_size, options.zig_zag))
345+
grid=(options.grid_size, options.zig_zag))
346346

347347
if options.profile:
348348
try:
@@ -351,7 +351,7 @@ def process(options):
351351
pf.log_profile()
352352
if pb:
353353
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))
355355

356356
return EXIT_SUCCESS
357357

0 commit comments

Comments
 (0)