---
name: "spd"
section: "1"
platform: "linux"
package: "spd"
version: "1.3.0-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/spd"
---

# spd(1)

SPatial Distortion Program

## NAME

spd - SPatial Distortion Program

## SYNOPSIS

Synchrotron image corrections and azimuthal integration

## DESCRIPTION

SPD stands for SPatial Distortion. Written in C language, this command-line  driven program deals with images coming from X-ray diffusion/diffraction  experiments. It does subsequently:\
  \* intensity corrections (dark current, flat field correction, ...),\
  \* geometry corrections using spline files or a pair of distortion arrays,\
  \* azimuthal integration in 2D or 1D after masking defective pixels.  SPD was originally written by Jorg Klora for ESRF and was re-written by Peter Boesecke from ESRF/ID02. Maintenance and packaging of the program are provided by Rainer Wilcke and Jerome Kieffer from SciSoft at ESRF.

## OPTIONS

Usage: spd \[--server\] \[--exit\]  parameter=option \[filenames\]

src\_id=\<source image shared memory id\>

src\_ext=\<source image file extension\> (default none)

cor\_id=\<shared memory id of corrected image\>

cor\_ext=\<corrected image file extension\> (default none)

type=\<output data type\> (default "FloatIEEE32")

dvo=\<value\> data value offset (default 0)

dark\_id=\<dark image shared memory id\>

dark\_file=\<dark image file name\>

dark\_const=\<value\> subtract constant dark image value \
 	default: no dark image subtraction done

dark\_ext=\<dark image file extension\> \
 	default none

do\_dark=0\|1 if 0, suppress dark image correction  default 1

save\_dark=0\|1\|2 save dark image memory to file\
  0: never, 1: always, 2: only if new (default 2)

inp\_const=\<value\> add input image constant (default 0.)

inp\_exp=\<value\> apply exponent to input image (default 1.)

inp\_factor=\<value\> multiply with input image factor (default 1.)

raw\_cmpr="none"\|"gzip"\|"z" compression of raw & dark images (default none)

flood\_id=\<flood field image shared memory id\> (or flat field)

flood\_file=\<flood field image file name\> (default: no flood field used)

bckg\_id=\<scattering background image shared memory id\>

bckg\_file=\<scattering background image file name\> (default: no scattering background used)

bckg\_const=\<additive scattering constant\> (default 0.)

bckg\_fact=\<constant scattering factor\> (default 1.)

header\_id=\<shared memory id for data header\> (default: not used)

pass=0\|1 pass input file header to output (default 0)

header\_min=\<minimum header length for output file\> (default 0)

header\_ext=\<extension for header output file\> (default none)

distortion\_file=\<file\> (default "spatial.dat")

xfile=\<file\> (x distortion read from edf file)

yfile=\<file\> (y distortion read from edf file)

xoutfile=\<file\> (x distortion saved to edf file)

youtfile=\<file\> (y distortion saved to edf file)

active\_radius=\<value\> (values outside will not be corrected)

precen\_1=xxx for pre-rotation center\_1 (default calculated)

precen\_2=xxx for pre-rotation center\_2 (default calculated)

predis=xxx for pre-rotation distance (default calculated)

prerot\_1=\<angle (rad) for pre-rotation around axis 1\> (default 0.)

prerot\_2=\<angle (rad) for pre-rotation around axis 2\> (default 0.)

prerot\_3=\<angle (rad) for pre-rotation around axis 3\> (default 0.)

psize\_distort=0\|1\|2 take image params from distortion file 0: none, 1: pix, 2: pix, cen, dis, proj, rot (default 0)

cen\_1=xxx if set, defines Center\_1 header value

cen\_2=xxx if set, defines Center\_2 header value

i0=xxx if set, defines Intensity0 header value

i1=xxx if set, defines Intensity1 header value

off\_1=xxx if set, defines Offset\_1 header value

off\_2=xxx if set, defines Offset\_2 header value

pix\_1=xxx if set, defines PSize\_1 header value

pix\_2=xxx if set, defines PSize\_2 header value

bis\_1=xxx if set, defines BSize\_1 header value

bis\_2=xxx if set, defines BSize\_2 header value

dis=xxx if set, defines SampleDistance header value

ori=xxx if set, defines RasterOrientation header value

tit=xxx if set, defines Title header value

wvl=xxx if set, defines WaveLength header value

pro="Saxs"\|"Waxs" projection type of image (default Saxs)

rot\_1=\<angle (rad) for detector rotation plane 1\> (default 0.)

rot\_2=\<angle (rad) for detector rotation plane 2\> (default 0.)

rot\_3=\<angle (rad) for detector rotation plane 3\> (default 0.)

base\_name=\<name\> (default "image")

outdir=\<pathname\> directory for output files (default: base\_name)

verbose=-1\|0\|1\|2 message printing level (low -\> high, default 1)

version=0\|1 print version string of the program if != 0

simul=0\|1 (default 0)

do\_distortion=0\|1\|2\|3 distortion correction (default 1)\
 	(0: none, 1: after dark, 2: after flat, 3: after norm)

flat\_distortion=0\|1 normalize to flat imgage (default 1)

do\_prerotation=0\|1\|2 pre-rotation correction (default 1)\
 	(0: none, 1: after, 2: without distortion correction)

norm\_int=0\|1 intensity normalization (default 0 = no)

norm\_factor=\<intensity normalization factor\> (default 1.)

overflow=xxx (default 0 = not set)

dummy=\<value\> (default 0. = not set)

inp\_min=\<value\> (default 0. = not set)

inp\_max=\<value\> (default 0. = not set)

bin\_1=\<value\> factor for x-binning (default 1 = no binning)

bin\_2=\<value\> factor for y-binning (default 1 = no binning)

 azim\_int=0\|1 azimuthal regrouping (default 0 = no)

azim\_pass=0\|1 pass full header to azimuthal regrouping (def. 1 = yes)

azim\_pro="Saxs"\|"Waxs" project. type of azim. regrp. (default Saxs)

azim\_id=\<shared memory id of regrouped image\> (default -1)

azim\_ext=\<file extension of regrouped image\> (default none)

azim\_r0=\<value\> minimum regrouping radius (default 0.)

azim\_r\_num=\<value\> radial output size (default 0)

azim\_a0=\<degrees\> 1st regrouping start angle (default 0.)

azim\_a1=\<degrees\> 2nd regrouping start angle (default: not used)

azim\_da=\<degrees\> angular regrouping interval (default 1.)

azim\_a\_num=\<value\> angular output size (default 0)

ave\_id=\<shared memory id of averaged image\> (default -1)

ave\_ext=\<file extension of averaged image\> (default none)

ave\_scf=\<scale factor for "s" values\> (default 1.)

mask\_file=\<azimuthal regrouping mask file name\>\
  (default: not used)

\--server switch to server mode, i.e. wait for\
  new command/image to process on stdin

\--exit quit the program when we are on server mode.

## BUGS

Azimuthal integration can only be achieved if a wavelength is given, even if  it is not needed for any calculation.

SPD was developed at ESRF and is tightly bound to Spec shared-memory arrays (http://www.certif.com) and EDF (ESRF Data Format) images, both in input and output.
