Options and Arguments of the SAXS Programs
*Version: 2000-09-04
*Introduction
*Prompts
*Arguments
*Options
*Reference Systems
*Orientation
*List of Options
*Example:
*Option Values
*Arithmetic Expressions as Values
*General Options Used in All SAXS Programs
*General Options for Output and Input Files
*Image Numbers and Memory Numbers
*File Access
*Loop Control
*Transformation of Input and Output Images
*Image Dimension
*Reference System Parameters
*SAXS Program Specific Options
*binary2saxs
*ccd2saxs
*gas2saxs
*gel2saxs
*saxs_add
*saxs_addcol
*saxs_addrow
*saxs_aff
*saxs_ascii
*saxs_ave
*saxs_angle
*saxs_bsl
*saxs_cave
*saxs_clip
*saxs_col
*saxs_const
*saxs_csub
*saxs_cut
*saxs_div
*saxs_divcol
*saxs_divrow
*saxs_gnaw
*saxs_log
*saxs_mac
*saxs_mul
*saxs_mulcol
*saxs_mulrow
*saxs_normn
*saxs_patch
*saxs_power
*saxs_rot
*saxs_row
*saxs_scal
*saxs_stat
*saxs_sub
*saxs_subcol
*saxs_subrow
*saxs_tiff
*saxs_urol
*Other Routines
*Programs
*col2array
*Macros
*saxsdisp.mac
*Index
*Options and Arguments of the SAXS Programs
Parameters can be passed in three ways to the saxs programs:
a) by prompts
b) by arguments
c) by options
The multiplication of the first three images of the input file "x.edf" with the factor 5.5 is used to demonstrate these possibilities. The output is written to "y.edf"
The program prompts for some important parameters, but not for all.
> saxs_mac
Usage: saxs_mac [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <ofac> <ocon> <shft1> <shft2>
saxs_mac saxs_mac 3.12 24-May-1995, Peter Boesecke
Input sequence 1 [input.edf] : x.edf <return>
Output sequence [output.edf] : y.edf <return>
First image of input sequence 1 [1] : <return>
Last image of input sequence 1 [1] : 3 <return>
Increment of input sequence 1 [1] : <return>
Output dummy [0.000000e+00] : -1 <return>
Output dimension 1 [1024] : <return>
Output dimension 2 [1024] : <return>
<output image> = <input image> * Factor + Const
Multiplication factor [1.000000e+00] : 5.5 <return>
<output image> = <input image> * Factor + Const
Addition constant [0.000000e+00] : <return>
Input reference system is Image
output shift 1 [0.000000e+00] :
Input reference system is Image
output shift 2 [0.000000e+00] :
...
...
The same parameters can be passed as arguments in the same order as the program would prompt for them. "=" stands for an empty argument. The option -p is used to switch off the prompt mode. With +p the program will prompt and will show the arguments as defaults in parenthesis []. This can be used for checks.
> saxs_mac -p x.edf y.edf = 3 = -1 = = 5.5 = = =
Usually, the default of all arguments can be set with options. While arguments must be passed in a specific order options can be passed in any order before the first argument. Options are preceeded by "-" or "+" and can be repeated. The last occurence sets the value.
> saxs_mac -p -i1nam x.edf -onam y.edf -i1lst 3 -odum -1 -i1fac 5.5
Currently, six different reference systems are defined: array, image, center, real, normal, saxs. They are used to define the geometrical relation between two images. A reference system is chosen with the option -rsys <refsys> (see chapter Option Values);
The orientation of the image describes the relation between data indices and directions in real space. In orientation 1 index 1 corresponds to the horizontal axis and index 2 to the vertical axis. Internally, all images are converted to orientation 1. The conversion includes a reorientation of the image and a swapping of some header values, e.g. for dimension, pixel size and offset. The orientation of the input and output image can be chosen with the options -i1ori O and oori O, where O is the orientation number shown in Fig. 1.
Each option in the following list is followed by a parenthesis that shows the number of parameters and the parameter type:
option [<num of parameters>,<typ>]
The saxs programs are called in the following way:
saxs_xxx [option] {[option]} [argument] {[argument]}
Options are preceeded by '-' or '+'. Options are read from left to right
and are processed before the arguments are read. Options can be repeated.
The last option sets the value.
saxs_normn +flat -i3nam "flat_field" -trm 0.78 -ofac 1/0.0003 \
image.edf = = image.nrm
Each option can be followed by parameters. The number of parameters
and the type of the parameter are shown in brackets. The following parameter
types are used:
(array, image, center, real, normal, saxs), e.g. -rsys saxs
Arithmetic Expressions as Values
Integer and float values can be expressed by C-type expressions. Additional
functions and constants are defined. Values are usually converted to
SI-units, e.g. keV is converted to Joule.
physical constants from:
Lawrence Berkeley Laboratory
University of California
Berkeley, California 94720
X-Ray data booklet, second printing, with corrections, April 1996
gamma = 0.577215664901532861;
kb = 1.380662e-23; /* Boltzmann constant (J/K) */
me = 9.109534e-31; /* electron rest mass (kg) */
mp = 1.6726485e-27; /* proton rest mass (kg) */
na = 6.022045e23; /* Avogadro number (1/mol) */
pi = 3.1415926535897932384626;
re = 2.8179380e-15; /* classical electron radius (m) */
c = 2.99792458e8; /* velocity of light (m/s) */
e = 1.6021892e-19; /* electron charge (C) */
h = 6.626176e-34; /* Planck's number (J*s) */
barn_ = 1e-28; /* barn (1/m^2) */
amu_ = 1.6605655e-27; /* atomic mass unit (kg) */
keV_ = e*1e3; /* _keV (J) */
eV_ = e; /* _eV (J) */
km_ = 1e3; /* _KM (m) */
m_ = 1.0; /* _M (m) */
cm_ = 0.01; /* _CM (m) */
mm_ = 1e-3; /* _MM (m) */
um_ = 1e-6; /* _UM (m) */
nm_ = 1e-9; /* _NM (m) */
rad(x) = pi/180.0 * x; /* transformation deg to rad */
deg(x) = 180.0/pi * x; /* transformation rad to deg */
pi(x) = pi;
sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)
atan2(x,y)
sinh(x)
cosh(x)
tanh(x)
floor(x)
ceil(x)
abs(x)
exp(x)
log(x)
log10(x)
pow(x)
sqrt(x)
round(x) = floor( x + 0.5 ); /* rounding */
true = 1l;
false = 0l;
yes = 1l;
no = 0l;
(long int) x : transformation of x to long integer;
(round) x : rounding and transformation of x to long integer;
General Options Used in All SAXS Programs
An option can be followed one or more parameters. All options are described in the following way:
<option name> [<number_of_parameters>, <parameter type>]
switches a test modus on (+test) and off (-test)
displays long (+h) and short (-h) help
switches prompt mode on (+p) and off (-p)
do not use, undefined behaviour
do not use, undefined behaviour
defines the reference system (-rsys array | image | real | saxs). The default value is image.
defines the user reference system (-usys array | image | real | saxs). The default value is usys.
defines, whether the edf output file will be preceeded by a general
block (+gblk) or not (-gblk) (default: -gblk)
(see description of new edf format)
selects globally the input byte order of bsl files. All bsl files that are read by a single routine must have the same byte order, allowed values (not case-sensitive): low_byte_first, high_byte_first (default: internal byte order of the machine, e.g. i386 -> LOW_BYTE_FIRST, all others currently -> HIGH_BYTE_FIRST)
sets the maximum line width in the output file. Lines longer than mlw will be terminated with a backlash and continued in the next line, default: not set.
General Options for Output and Input Files
The following options can be used for output and for input files. An option for the output file starts with o, an option for the <n>-th input file starts with i<n>, e.g. -odum -1 -i1dum -1 -i2dum -1 etc. The number of input and output files can be viewed with the extended help option +h (block should be read as file):
...
Number of image blocks : 3
Maximum number <n> of input blocks: 2
...
The file contains 1 output file (-onam <output file name>) and 2 input files (-i1nam <name of input file 1>, -i2nam <name of input file 2>).
Some conversion programs do not have standard input and output files, e.g. gas2saxs. In this case the number of image files ("blocks") is 0.
Image Numbers and Memory Numbers
Image numbers offer the possibility to store a sequence of (small) images in a single file. All images are numbered and can be stored in different memories. Image numbers and memory numbers are integer values. Positive memory values stand for image data, negative memory values for error data. Memory zero must not be used. The default input memory number is 1, the default output memory number is the input memory number.
How image numbers can be chosen is described in the section Loop Control. Memory numbers can be chosen with the options -i<n>mem and -omem.
memory number of images in output (input) file, e.g. -omem -1.
output (input) file opening mode, e.g. -i1mod o -omod n+ip: open an existing file for reading and create a new output file, protect the images of the output file
output (input) file name, e.g. -i1nam "input.edf" -onam "output.edf"
The file "/dev/null" is used as dummy. Used as input, a saxs_xxx programs runs as if it would read from a file. All parameters can be defined explicitly by options, e.g. saxs_mac -i1dim 512 512 -i1con 5 /dev/null output.edf will create an image with 512 512 pixels and write it to output.edf. Each pixel has the value 5. Output to "/dev/null" suppresses the output to a real file.
All saxs_xxx programs read images sequentially from several input sequences (i1, i2, ...) and write the resulting images sequentially to a single output sequence (o). Per default the output images are described in the same way as the images of the first input sequence, e.g. title, pixel size etc. are copied from the input images of the first sequence. Only a single output image sequence is created: (Output[i01], Output[i02], ...). The output image is a function of the input images: Output[i0] = Function(image1[i1], image2[i2], image3[i3], ..., imageN[iN]). Per default, the start number (ofst), the increment (oinc) and the last number (olst) of the output image sequence are the same as start number (i1fst), increment (i1inc) and last number (i1lst) of the first input sequence. Thus, normally the output image number is equal to the number of the image in the FIRST input file.
i1fst, i1inc, i1lst -> maxloop1 = max(1,(i1lst-i1fst+1)/i1inc)
...
iNfst, iNinc, iNlst -> maxloopN = max(1,(iNlst-iNfst+1)/iNinc)
ofst, oinc, olst -> maxloop0 = max(1,(i0lst-i0fst+1)/i0inc)
maxloop = Min(loop1, .. , loopN, loop0)
If the increment of the output image is 0, maxloop0 is set to infinity and it is only written once at the end of the other loops.
If the increment of an input sequence J is zero the loop is stopped after the first loop (maxloopJ is set to 1).
The loop is stopped when the first incrementation loop has finished. Also negative increments are possible.
ImageLoop(...) {
for (O=OFirst,I1=I1First,I2=I2First,...;
O<OLast,I1<I1Last,I2<I2Last,...;O+=OInc,I1+=I1Inc,I2+=I2Inc) {
Read(I1,I2,...);
Function((CmdBlk * ) pcb, (ImgHeadBlk *) ihb, (int *) pstatus );
Write(O); }
}
Missing images are skipped. All start images must exist.
first image number of output (input) file, e.g. -i1fst 10 -ofst 10
last image number of output (input) file, e.g. -i1lst 20 -olst 20
increment of image number of output (input) file, e.g. -i1inc 2 -oinc 2, if oinc (i<n>inc) is 0 the ouput image is only written once at the end of the loop (the input image is only read once)
Transformation of Input and Output Images
After reading and before writing the pixel values of all images can be modified. The transformations are done in the following order after reading the input data and before writing to the output file. If the option is omitted nothing is done.
clip (-omin, -omax),
gnaw (-ogna),
rebin (-obin),
orientation (-oori)
transform (-ocon, -ofac))
Attention, each step can create new dummy pixels, e.g. -odum 10 -ofac 0 -ocon 10 would replace all output pixels with the value 10 which is the dummy value.
minimum value in output (input) image, e.g. -omin 0.01, lower values are replaced with dummies
maximum value in output (input) image, e.g. -omax 10000, larger values are replaced with dummies
constant is added to output (input) image value before saving, e.g. -ocon 1000 (-i1con 1000), adds 1000 to each non-dummy pixel of an image before saving (after reading). Multiplication and addition are done at the same time according to: value' = value * factor + constant).
factor is multiplied to output (input) image value before saving, e.g. -ofac 0.37 (-i1fac), multiplies each non-dummy pixel of an image with 0.37 before it is saved (after it was read). Multiplication and addition are done at the same time according to: value' = value * factor + constant).
rebinning factor of the output (input) images, e.g. -obin 2 2 rebins the output image by a factor 2. The image dimension is automatically adapted.
input: input image is transformed from orientation i<n>ori to
output: output image is transformed from orientation 1 to orientation oori
The value range of ori is from 1 to 8 (see Fig. 1)
rounding of the dummy area of the output (input) images, e.g. -ogna 2 4 enlarges each dummy pixel by 2 pixels horizontally and by 4 pixels vertically.
dimension of each output (input) image, e.g. -odim 720 1000 sets the output dimension horizontally to 720 and vertically to 1000. Unused pixels are filled with dummy. This option overwrites the header information of an input image.
In case of an input image this dimension is used instead of the value coming with the image.
dummy value of each output (input) image, e.g. -odum -1 sets the output dummy value to -1. The value 0 is never a dummy. A value is a dummy if (abs(value - dummy) <= ddummy) (with ddummy > 0.1). Dummy values are ignored in calculations and are replaced by the output dummy value. This option overwrites the header information of an input image.
In case of an input image this dummy value is used instead of the value coming with the image.
ddummy value, radius around a dummy value, in which the pixel values are ignored. This value is automatically set and must be always larger than 0.1. There should be no need to use this option. See odum. This option overwrites the header information of an input image.
In case of an input image this ddummy value is used instead of the value coming with the image.
output (input) image title, e.g. -otit "black sample"
In case of an input image this title string is used instead of the title coming with the image.
(reserved for time string)
The reference system for calculation is globally chosen with rsys. The reference systems are described in a separate document.
offset of the output (input) image (in pixel)
This option overwrites the header information of an input image.
In case of an input image this offset is used instead of the offset coming with the image.
center of the output (input) image (in pixel). This option overwrites the header information of an input image.
In case of an input image this center is used instead of the center coming with the image.
pixel size of the output (input) image (in meters). This option overwrites the header information of an input image.
In case of an input image this pixel size is used instead of the pixel size coming with the image.
sample distance in the output (input) image (in meters). This option overwrites the header information of an input image.
In case of an input image this distance is used instead of the distance coming with the image.
wavelength in the output (input) image (in meters). This option overwrites the header information of an input image.
In case of an input image this wavelength is used instead of the wavelength coming with the image.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
binary2saxs [options] <fnam> <onam> <i1dim1> <i1dim2> <fskp> <ftyp> <odum>
Options
number of bytes to skip
binary file name
binary type : type of a single element
byte swapping on/off (+fend: swap bytes, -fend: keep byte order (default))
Number of image blocks : 0
Arguments
ccd2saxs [options] <i/p file> <dummy> <first> <last> <inc> <o/p file> <o/p first> <i/p hm>
Options
extension of the edf output file (default: ".edf")
Number of image blocks : 0
Arguments
gas2saxs [options] <i/p file> <dummy> <first> <last> <inc> <o/p file> <o/p first> <i/p hm>
Options
extension of the edf output file (default: ".edf")
Number of image blocks : 0
Arguments
gel2saxs [options] <i/p file> <dummy> <o/p file>
Addition of two image sequences
Arguments
saxs_add [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Average columns between col1 and col2 in image sequence 2 and add the results to each column of image sequence 1
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_addcol [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first column
last column
Average rows between row1 and row2 in image sequence 2 and add the result to each row of image sequence 1
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_addrow [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first row
last row
Affine transformation of an image sequence
Tranformation matrix T
with coordinates W (input image), W' (output image)
see also: saxs_rot
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_aff [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2>
<t00> <t01> <t10> <t11> <t20> <t21>
Options
transformation matrix element T00 (default: 1.0)
transformation matrix element T10 (default: 0.0)
transformation matrix element T20 (default: 0.0)
transformation matrix element T01 (default: 1.0)
transformation matrix element T11 (default: 0.0)
transformation matrix element T21 (default: 0.0)
Transformation of an edf-file into ASCII format
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_ascii [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2>
<header> <swap> <head_1> <head_2>
Options
-scf <factor> : multiplication of coordinates with a scale factor, e.g. to tranform s in nm to q=2*pi*s in Angstrom (-scf "0.2*pi")
-pref 'prefix' : specify the prefix of the ouptput file
-ext 'extension' : extension of the output ascii file (default: ".txt")
+-head : enables/disables the header printing
+-swap : enables/disables swap of rows and lines
+-hd1 : enables/disables the i_1 coordinate printing
+-hd2 : enables/disables the i_2 coordinate printing
+-abs : print absolut values of coordinates
+-spc : spacer between data columns, default: tabulator
Averaging of two image sequences
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_ave [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Transformation from cartesian coordinates to polar coordinates with pixel interpolation and azimuthal averaging.
x_1 of the output file corresponds to the radius
x_2 of the output file corresponds to the angle
The angle coordinate (x_2) uses always the real reference system (Offset, PixSiz). Center, WaveLength and SampleDistance are not used.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_angle [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <odum>
<i1cen1> <i1cen2> <r0> <dr> <dim1> <a0> <da> <dim2>
Options
-r0 <minimum radius>: default 0.0
-dr <radial interval>: default is a value that corresponds to 1 pixel
-a0 <azimuthal start angle [deg]>: default 0.0 deg
-da <azimuthal interval [deg]>: default 1 deg
+-s2 This option is used to multiply the input data with the square of the radius (in rsys units) before transformation. This allows the direct calculation of the scattering power re^2*Q/V from the data by summation over i_1. (default: no multiplication)
The options asym and csym are used together with the option s2. They allow proper azimuthal averaging of intensities when the scattering pattern shows fiber symmetry and the fiber axis is lying in the detector plane. The angle of the fiber axis with the w_1 axis is defined by the option asym.
-asym <rotation of the symmetry axis relative to the w_1 axis [deg]>: default: 0.0 deg
+-csym switches on/off the multiplication of the input pattern with Pi/2*sin(Alpha-ASym), where Alpha is the angle of the data point from the w_1 axis and ASym the angle of the symmetry axis from the w_1 axis (default: no multiplication).
Transformation of an edf image sequence into bsl format (daresbury otoko)
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_bsl [options]
<i1nam> <output header name> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2>
Options
-hnam <output header name>: XNNMMM.EDF (default: automatically created from input filename)
+bsl : write into a single bsl binary file (default: -bsl)
Averaging of a point mirrored sequence with itself.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_cave [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <center1> <center2>
Options
-cen1 <WCenter_1> : center 1 (input: user system coordinate, coordinate calculated according to first image)
-cen2 <WCenter_2> : center 2 (input: user system coordinate,coordinate calculated according to first image)
Sets all values above maxclip to maxvalue and all values that are smaller than minclip to minvalue. Works like -min and -max on the read data (after transformation and binning), but the excluded pixels are set to minimum and maximum (not to dummy).
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_clip [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <micl> <macl>
Options
-macl : maximum
-micl : minimum
Projection of a vertical band in a sequence of images to a single column. The output column is swapped to a line. The swapped column is written to a line of the output image.
see also saxs_row
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_col [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <col1> <col2>
Options
first column of the vertical band (input: user system coordinate, coordinate calculated according to first image)
last column of the vertical band (input: user system coordinate, coordinate calculated according to first image)
first row of the input image (input: user system coordinate, coordinate calculated according to first image)
last row of the input image (input: user system coordinate, coordinate calculated according to first image)
switch between summation (+vsum) and integration/averaging (-vsum) of the data values (default: integration/averaging). The options +vint +vint cannot be set at the same time.
switch between integration (+vint) and averaging (-vint) of the data values (default: averaging). The options +vint +vint cannot be set at the same time.
aliased to --> saxs_mac
Subtraction of a point mirrored sequence from itself.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_csub [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <center1> <center2>
Options
-cen1 <WCenter_1> : center 1 (input: user system coordinate, coordinate calculated according to first image)
-cen2 <WCenter_2> : center 2 (input: user system coordinate, coordinate calculated according to first image))
Unroll an image around by radial cuts around a center. (Radial cuts through subsequent sectors). The radial intensities are written line by line to the output file.
See also: saxs_urol
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_cut[options]
<i/p file> <o/p file> <first> <last> <inc>
<psize1> <psize2> <center1> <center2> <Rmin>
<DeltaR> <NR> <Alphamin> <DeltaAlpha> <NAlpha> <o/p file>
Options
minimum radius (default: 0.0)
radial step size (default: 1.0)
minimum azimuthal angle [deg] (default: 0.0)
azimuthal step size (default: 1.0)
number of radial steps (default: 100)
number of azimuthal steps (default 360)
Division of two image sequences. To calculate the inverse of each image in an image sequence with the name x.edf type: saxs_div -i1fac 0 -i1con 1 -i1nam x.edf -i2nam x.edf
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_div [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Average columns between col1 and col2 in image sequence 2 and divide each column of image sequence 1 by the results
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_divcol [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first column
last column
Average rows between row1 and row2 in image sequence 2 and divide each row of image sequence 1 by the result
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_divrow [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first row
last row
Sets pixels in an ellipse around a dummy also to dummy. Similar to the general option +ogna <gnc> <gnr>.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_gnaw [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <gnc> <gnr>
Options
horizontal radius
vertical radius
Logarithm (base 10) of the image. To calculate the logarithm to another base multiply the output with -ofac "log(<base>)/log(10)"
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_log [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2>
Mulitplication with a factor and addition of a constant to each image in a sequence. This routine performs a simple read and write of an image sequence. All general options are available and can be used to modify the values, e.g. to multiply with a factor and to add a constant: +ofac <fac> +ocon <con>. To convert an edf-file or bsl file to a standard edf-file with 512 byte block size and float binaries type saxs_mac old.edf new.edf or saxs_mac A01000.BSL new.edf.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_mac [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <ofac> <ocon> <shft1> <shft2>
Multiplication of two image sequences.
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_mul [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Average columns between col1 and col2 in image sequence 2 and multiply each column of image sequence 1 with the results
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_mulcol [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first column
last column
Average rows between row1 and row2 in image sequence 2 and multiply each row of image sequence 1 with the result
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_mulrow [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first row
last row
Normalization of an image sequence to absolute intensities (+ccd for ccd, -ccd for delay line detector, default: -ccd)
Number of image blocks : 4
Maximum number <n> of input blocks: 3
Arguments
saxs_normn [options]
<i/p file> <scaler file> [<flatfield file>] <o/p file>
<first image> <last image> <inc>
<first scaler header> <inc scaler header>
[<flatfield image>]
<o/p dummy> <o/p dim1> <o/p dim2>
<transmission>
<scaler I0 mon.> <scaler exposure time> <scaler anode counts>
<2nd scaler I0 mon.> <2nd scaler exposure time> <2nd scaler anode counts>
Method
The normalization is done in the following way:
The values of timc, timf etc. are stored as keywords in the header of the raw data file. To convert the output image to absolute values it has to be devided by the flat field file [event/photon].
The second scalers are only used if (count2*calib2>max_count*calib1) where max_count is defined as maxcount = 2^ScalerDepth. If the number of the second scaler is set to 0 it will not be used.
Options
transmission (0..1)
eff. scaler depth in bits,
e.g. scaler depth=24 and 4 accumulations
=> -dpth "24+log(4)/log(2)" = 26
absolute counts of I0 scaler
zero value of I0 scaler
factor of I0 scaler (conversion of counts to photons)
number of incident photons
absolute counts of time scaler
factor of time scaler (for conversion of counts to seconds)
exposure time in seconds
absolute counts of anode scaler
factor of anode counter (for conversion of counts to anode counts, usually 1)
zero value of anode scaler
anode value in counts
absolute counts of I1 scaler
zero value of I1 scaler
factor of I1 scaler (conversion of counts to photons)
number of transmitted photons
absolute counts of second I0 scaler
factor of second I0 scaler (conversion of counts to photons)
absolute counts of second time scaler
factor of second time scaler (for conversion of counts to seconds)
absolute counts of second anode scaler
factor of second anode scaler (for conversion of counts to anode counts)
absolute counts of second I1 scaler
factor of second I1 scaler
sum of input image 1. This option can be used to set the sum of the input image externally.
The option -i1bin a b averages over a*b pixels. To calculate afterwards the correct rejection the binning correction factor must be set to -bcf "a*b". The binning correction factor cancels out and has no effect on the output image data, but only on the displayed acceptance and rejection values.
relative distance of sample from homne position of detector displacement. If RelDis is set, the value of SampleDistance is ignored and replaced by the sum of DetectorPosition plus RelDis in input sequence 1 and 2 (i1 and i2) and in the output sequence (o). The value of DetectorPosition is read from input sequence 2.
number of I0 monitor scaler
number of exposure time scaler
number of anode counts scaler
number of I1 monitor scaler
number of second I0 monitor scaler
number of second exposure time scaler
number of second anode count scaler
number of second I1 monitor scaler
scaler length total number of available scalers (1..slen)
flatfield correction/no floatfield correction
Replacement of the first image by the second image (where it is defined). The second image is patched into the first image.
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_patch [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2>
Options
Calculate the n-th power of each image value
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_power [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <power>
Options
power exponent
Rotation of an image sequence by alfa
with coordinates W (input image), W' (output image)
see also: saxs_aff
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_rot [options] <i1nam> <onam> <i1fst> <i1lst> <i1inc> <odum> <odim1> <odim2> <alfa>
Options
ccw-rotation of the image-in degree. The rotation center is the origin of the chosen reference system.
Projection of a horizontal band in a sequence of images to a single row. The row is written to a line of the output image.
see also: saxs_col
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_row [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <row1> <row2>
Options
first column of the input image (input: user system coordinate, coordinate calculated according to first image)
last column of the input image (input: user system coordinate, coordinate calculated according to first image)
first row of the horizontal band (input: user system coordinate, coordinate calculated according to first image)
last row of the horizontal band (input: user system coordinate, coordinate calculated according to first image)
switch between summation (+vsum) and integration/averaging (-vsum) of the data values (default: integration/averaging). The options +vint +vint cannot be set at the same time.
switch between integration (+vint) and averaging (-vint) of the data values (default: averaging). The options +vint +vint cannot be set at the same time.
Read the value of a keyword from the headers of each picture and write it to a text file.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_scal [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <keyword>
Options
Keyword
Prefix of the output file
Extension of the output file
Name of the output file
Calculates statistics of the input image and write the result into a text file.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_stat [options]
<i1nam> <i2nam> <o/p prefix> <i1fst> <i1lst> <i1inc>
<selection>
Options
selection
Prefix of the output file
Extension of the output file
Name of the output file
Print results to the standard output
Subtraction of two image sequences
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_sub [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Average columns between col1 and col2 in image sequence 2 and subtract the results from each column of image sequence 1
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_subcol [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first column
last column
Average rows between row1 and row2 in image sequence 2 and subtract the result from each row of image sequence 1
Number of image blocks : 3
Maximum number <n> of input blocks: 2
Arguments
saxs_subrow [options]
<i1nam> <onam> <i1fst> <i1lst> <i1inc> <i2fst>
<odum> <odim1> <odim2> <i1con> <i1fac> <i2con> <i2fac>
<ocon> <ofac>
Options
first row
last row
Transformation of an edf image sequence to 1byte/2byte/4byte tiff files. If more than 1 image is read from the input file the output files are numbered. The input file is first converted to an intermediate output file and then converted to a tiff file. The output dummy is never scaled. The title is written as comment into the tiff file. The outptu byte order is given by the machine byte order.
Hint: To convert a 16 bit unsigned integer edf-raw data file to a tiff files with 16 bps the options "-auto -bps 16" should be set. If the file contains dummy values the output dummy value should be set to a positive value inside the mapping range. If it lies outside the output range it is forced to the closest number inside the output range.
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_tiff [options]
<i1nam> <tiff file name -tnam> <i1fst> <i1lst> <i1inc>
<odum> <odim1> <odim2> <8|16|32-bps> <1-8-rori>
<auto> [<min> <max>]
Options
bits per sample in output tiff image
<8|16|32> : 8, 16 and 32 bits in tiff image (default 16)
orientation of the output tiff image
1: (x,y)
2: (-x,y) x-axis inverted
3: (x,-y) y-axis inverted (default)
4: (-x,-y) both axes inverted
5: (y,x) axes swapped
6: (y,-x) axes swapped and x-axis inverted
7: (-y,x) axes swapped and y-axis inverted
8: (-y,-x) axes swapped and both axes inverted
-auto: As usual, the output dummy is set to -odum or its default. If not explicitely set by -min or -max, minimum and maximum of the input image are set 0 and pow(2,bps)-1, all values in the range [minimum, maximum] are mapped to [0,(pow(2,bps)-1)]
+auto: The output dummy is set to upper range value (pow(2,bps)-1). If not explicitely set by -min or -max, minimum and maximum of the input image are calculated, all values in the range [minimum, maximum] are mapped to [0,(pow(2,bps)-2)] (default +auto)
-auto should be used for format transformations, +auto for image display, e.g. with xv.
minimum of mapping range, values smaller or equal to min will be set to 0, all values in the range [minimum, maximum] are mapped to [0,(pow(2,bps)-1)]
maximum of mapping range, value larger or equal to max will be set to pow(2,bps), all values in the range [minimum, maximum] are mapped to [0,(pow(2,bps)-1)]
Example
saxs_tiff saxs_tiff 3.0 1999-11-12, Peter Boesecke
Input sequence 1 [input.edf] : flat.new230696
Output tiff file [flat.tif] :
First image of input sequence 1 [1] :
Last image of input sequence 1 [1] :
Increment of input sequence 1 [1] :
Output dummy [-1.000000e+00] :
Output dimension 1 [512] :
Output dimension 2 [512] :
Bits per sample (8, 16, 32) [16] :
Orientation of output image (1-8) [3] :
Range output image with minimum and maximum? [FALSE] :
Minimum value [0.000000e+00] :
Maximum value [6.553500e+04] :
input file : flat.new230696
output prefix : flat.tif
first image : 1
last image : 1
increment : 1
output dummy : -1.000000
output dimension 1 : 512
output dimension 2 : 512
bits per sample : 16
autorange : 0
minimum value : 0.000000
maximum value : 65535.000000
Reading image: flat.new230696, Image : 1 done
Calculating ihb[0, 1] = Function(ihb[ 1, 1] )
Input file : flat.new230696
Input image number : 1
Output tiff file : flat.tif
End of /home/boesecke/programs/saxs/bin/saxs_tiff
Unroll an image around a center. (Azimuthal averaging of subsequent sectors). The averaged radial intensities in each sector are written line by line to the output file.
see also: saxs_cut
Number of image blocks : 2
Maximum number <n> of input blocks: 1
Arguments
saxs_urol [options]
<i/p file> <o/p file> <first> <last> <inc>
<psize1> <psize2> <center1> <center2> <Rmin>
<DeltaR> <NR> <Alphamin> <DeltaAlpha> <NAlpha> <o/p file>
Options
minimum radius (default: 0.0)
radial step size (default: 1.0)
minimum azimuthal angle [deg] (default: 0.0)
azimuthal step size (default: 1.0)
number of radial steps (default: 100)
number of azimuthal steps (default 360)
A single column is extracted from a set of numbered ascii-input files and are rearranged to rows of a single ascii-output file. The columns must be separated by tabs ´\t´. The columns are numbered with 1, 2, 3 etc. from the start and -1, -2, -3 etc. from the end. The parameters must be entered in the described order. For omitted parameters default values are used.
Arguments
col2array [-h] [-b <mode[0]>] <output> <input> <first[1]> <last[1]> <inc[1]>
<col[1]> <skip_lines[0]> <skip_chars[0]> <separator['\t']>
Options
Example
The command
>> col2array output.txt input_###.txt 105 095 -3 -1 2 0
will read the last column of the files input_105.txt, input_102.txt, input_099.txt and input_096.txt and write it to output.txt. It will skip 2 lines and 0 characters at the start of each file.
Macros can only be used if the path to the saxs programs is defined in the shell initialization script (e.g. ".cshrc"). The initialization script must not change the directory.
A single image of an edf file is converted into 8 bps tiff format and displayed with xv. The output image is automatically scaled between 0 and 255. Dummy values are set to 255.
Arguments
saxs_disp <input> [<num>]