---
name: "sparsify-Bragg"
section: "1"
platform: "linux"
package: "pyfai"
version: "0.20.0+dfsg1-3"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/sparsify-Bragg"
---

# sparsify-Bragg(1)

Sparsify 2D single crystall diffraction images by separating Bragg peaks from background signal. Positive outlier pixels (i.e. Bragg peaks) are all recorded as they are without destruction. Peaks are not integrated. Background is calculated by an iterative sigma-clipping in the polar space. The number of iteration, the clipping value and the number of radial bins could be adjusted. This program requires OpenCL. The device needs be properly selected.

## NAME

sparsify-Bragg - Sparsify 2D single crystall diffraction images by separating Bragg peaks from background signal.

Positive outlier pixels (i.e. Bragg peaks) are all recorded as they are without destruction.  Peaks are not integrated.

Background is calculated by an iterative sigma-clipping in the polar space.  The number of iteration, the clipping value and the number of radial bins could be adjusted.

This program requires OpenCL. The device needs be properly selected.

## DESCRIPTION

usage: spasify-Bragg \[-h\] \[-V\] \[-v\] \[--debug\] \[-o OUTPUT\] \[--save-source\]

- \[-b BEAMLINE\] \[-p PONI\] \[-m MASK\] \[--dummy DUMMY\]

  \[--delta-dummy DELTA\_DUMMY\] \[--radial-range RADIAL\_RANGE RADIAL\_RANGE\] \[--bins BINS\] \[--cycle CYCLE\] \[--cutoff-clip CUTOFF\_CLIP\] \[--cutoff-pick CUTOFF\_PICK\] \[--error-model ERROR\_MODEL\] \[--noise NOISE\] \[--device DEVICE DEVICE\] \[--device-type DEVICE\_TYPE\] \[IMAGE ...\]

Sparsify 2D single crystall diffraction images by separating Bragg peaks from background signal. Positive outlier pixels (i.e. Bragg peaks) are all recorded as they are without destruction. Peaks are not integrated. Background is calculated by an iterative sigma-clipping in the polar space. The number of iteration, the clipping value and the number of radial bins could be adjusted. This program requires OpenCL. The device needs be properly selected.

### positional arguments:

- IMAGE

  File with input images. All frames will be concatenated in a single HDF5 file.

### optional arguments:

- **-h**, **--help**

  show this help message and exit

- **-V**, **--version**

  output version and exit

- **-v**, **--verbose**

  show information for each frame

- **--debug**

  show debug information

### main arguments:

- **-o** OUTPUT, **--output** OUTPUT

  Output filename

- **--save-source**

  save the path for all source files

### Experimental setup options:

- **-b** BEAMLINE, **--beamline** BEAMLINE

  Name of the instument (for the HDF5 NXinstrument)

- **-p** PONI, **--poni** PONI

  geometry description file

- **-m** MASK, **--mask** MASK

  mask to be used for invalid pixels

- **--dummy** DUMMY

  value of dynamically masked pixels

- **--delta-dummy** DELTA\_DUMMY

  precision for dummy value

- **--radial-range** RADIAL\_RANGE RADIAL\_RANGE

  radial range as a 2-tuple of number of pixels, by default all available range

### Sigma-clipping options:

- **--bins** BINS

  Number of radial bins to consider

- **--cycle** CYCLE

  precision for dummy value

- **--cutoff-clip** CUTOFF\_CLIP

  Threshold to be used when performing the sigmaclipping

- **--cutoff-pick** CUTOFF\_PICK

  Threshold to be used when picking the pixels to be saved

- **--error-model** ERROR\_MODEL

  Statistical model for the signal error, may be \`poisson\`(default) or \`azimuthal\` (slower)

- **--noise** NOISE

  Noise level: n-sigma cannot be smaller than this value

### Opencl setup options:

- **--device** DEVICE DEVICE

  definition of thee platform and device identifyer: 2 integers. Use \`clinfo\` to get a description of your system

- **--device-type** DEVICE\_TYPE

  device type like \`cpu\` or \`gpu\` or \`acc\`. Can help to select the proper device.

Current status of the program: status
