4
4
# Project: Fast Azimuthal integration
5
5
# https://github.com/silx-kit/pyFAI
6
6
#
7
- # Copyright (C) 2012-2021 European Synchrotron Radiation Facility, Grenoble, France
7
+ # Copyright (C) 2012-2022 European Synchrotron Radiation Facility, Grenoble, France
8
8
#
9
9
# Authors: Jérôme Kieffer <[email protected] >
10
10
#
27
27
# THE SOFTWARE.
28
28
#
29
29
30
- """peakfinder: Count the number of Bragg-peaks on an image
30
+ """peakfinder: Count the number of Bragg-peaks on an image.
31
31
32
32
Bragg peaks are local maxima of the background subtracted signal.
33
33
Peaks are integrated and variance propagated. The centroids are reported.
38
38
This program requires OpenCL. The device needs be properly selected.
39
39
"""
40
40
41
- __author__ = "Jerome Kieffer"
41
+ __author__ = "Jérôme Kieffer"
42
42
43
43
__license__ = "MIT"
44
44
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
45
45
__date__ = "03/02/2022"
46
- __status__ = "status "
46
+ __status__ = "production "
47
47
48
48
import os
49
49
import sys
50
50
import argparse
51
51
import time
52
52
from collections import OrderedDict
53
- import numpy
54
53
import numexpr
55
54
import logging
56
55
logging .basicConfig (level = logging .INFO )
@@ -98,32 +97,32 @@ def expand_args(args):
98
97
99
98
def parse ():
100
99
epilog = "Current status of the program: " + __status__
101
- parser = argparse .ArgumentParser (prog = "spasify-Bragg " ,
100
+ parser = argparse .ArgumentParser (prog = "peakfinder " ,
102
101
description = __doc__ ,
103
102
epilog = epilog )
104
103
parser .add_argument ("IMAGE" , nargs = "*" ,
105
104
help = "File with input images. All results are concatenated into a single HDF5 file." )
106
105
parser .add_argument ("-V" , "--version" , action = 'version' , version = version ,
107
106
help = "output version and exit" )
108
107
parser .add_argument ("-v" , "--verbose" , action = 'store_true' , dest = "verbose" , default = False ,
109
- help = "show information for each frame" )
108
+ help = "Show information for each frame" )
110
109
parser .add_argument ("--debug" , action = 'store_true' , dest = "debug" , default = False ,
111
- help = "show debug information" )
110
+ help = "Show debug information" )
112
111
parser .add_argument ("--profile" , action = 'store_true' , dest = "profile" , default = False ,
113
- help = "show profiling information" )
112
+ help = "Show profiling information" )
114
113
group = parser .add_argument_group ("main arguments" )
115
114
# group.add_argument("-l", "--list", action="store_true", dest="list", default=None,
116
115
# help="show the list of available formats and exit")
117
116
group .add_argument ("-o" , "--output" , default = 'spots.h5' , type = str ,
118
117
help = "Output filename" )
119
118
group .add_argument ("--save-source" , action = 'store_true' , dest = "save_source" , default = False ,
120
- help = "save the path for all source files" )
119
+ help = "Save the path for all source files" )
121
120
122
121
group = parser .add_argument_group ("Scan options" )
123
122
group .add_argument ("--grid-size" , nargs = 2 , type = int , dest = "grid_size" , default = None ,
124
- help = "Grid along which the data was acquired" )
123
+ help = "Grid along which the data was acquired, disabled by default " )
125
124
group .add_argument ("--zig-zag" , action = 'store_true' , dest = "zig_zag" , default = False ,
126
- help = "The scan was performed with a zig-zag pattern" )
125
+ help = "Build the 2D image considering the scan was performed with a zig-zag pattern" )
127
126
# TODO: implement those
128
127
# group = parser.add_argument_group("optional behaviour arguments")
129
128
# group.add_argument("-f", "--force", dest="force", action="store_true", default=False,
@@ -150,22 +149,22 @@ def parse():
150
149
group .add_argument ("-b" , "--beamline" , type = str , default = "beamline" ,
151
150
help = "Name of the instument (for the HDF5 NXinstrument)" )
152
151
group .add_argument ("-p" , "--poni" , type = str , default = None ,
153
- help = "geometry description file" )
152
+ help = "Geometry description file: Mandatory " )
154
153
group .add_argument ("-m" , "--mask" , type = str , default = None ,
155
- help = "mask to be used for invalid pixels" )
154
+ help = "Mask to be used for invalid pixels" )
156
155
group .add_argument ("--dummy" , type = float , default = None ,
157
- help = "value of dynamically masked pixels (disabled by default)" )
156
+ help = "Value of dynamically masked pixels (disabled by default)" )
158
157
group .add_argument ("--delta-dummy" , type = float , default = None ,
159
- help = "precision for dummy value" )
158
+ help = "Precision for dummy value" )
160
159
group .add_argument ("--radial-range" , dest = "radial_range" , nargs = 2 , type = float , default = None ,
161
160
help = "radial range as a 2-tuple of number of pixels (all available range by default)" )
162
161
group .add_argument ("-P" , "--polarization" , type = float , default = None ,
163
162
help = "Polarization factor of the incident beam [-1:1] (off by default, 0.99 is a good guess on synchrotrons" )
164
163
group .add_argument ("-A" , "--solidangle" , action = 'store_true' , default = None ,
165
164
help = "Correct for solid-angle correction (important if the detector is not mounted normally to the incident beam, off by default" )
166
165
group = parser .add_argument_group ("Sigma-clipping options" )
167
- group .add_argument ("--bins" , type = int , default = 1000 ,
168
- help = "Number of radial bins to consider (1000 by default)" )
166
+ group .add_argument ("--bins" , type = int , default = 800 ,
167
+ help = "Number of radial bins to consider (800 by default)" )
169
168
group .add_argument ("--unit" , type = str , default = "r_m" ,
170
169
help = "radial unit to perform the calculation (r_m by default)" )
171
170
group .add_argument ("--cycle" , type = int , default = 5 ,
@@ -178,9 +177,9 @@ def parse():
178
177
group .add_argument ("--cutoff-pick" , dest = "cutoff_pick" , type = float , default = 3.0 ,
179
178
help = "SNR threshold for considering a pixel high when searching for peaks (3 by default)" )
180
179
group .add_argument ("--noise" , type = float , default = 1.0 ,
181
- help = "Quadratically added noise to the background (1 by default" )
180
+ help = "Noise added quadratically to the background (1 by default" )
182
181
group .add_argument ("--patch-size" , type = int , default = 5 ,
183
- help = "size of the neighborhood for integration (5 by default)" )
182
+ help = "Size of the neighborhood patch for integration (5 by default)" )
184
183
group .add_argument ("--connected" , type = int , default = 3 ,
185
184
help = "Number of high pixels in neighborhood to be considered as a peak (3 by default)" )
186
185
group = parser .add_argument_group ("Opencl setup options" )
0 commit comments