Creating and Using Batch Files

Contents

Introduction and Overview

ADDMOVIEFRAME

APPENDTOFILE

APPLYFIT

APPLYMASK

AXISRANGE

AZIMUTH

BEAMCEN

CALCSTATISTICS

CHIOFFSET

COMMENT

CONDENSE

CONSTRUCTMODEL

CONTRAST

CONTOURSCALE

DETECTORAZIMUTH

DETECTORTWOTHETA

DEZING

DIAMETER

DOFIT

EXPORTPLOT

FILESWAP

FITVSQ

FLIPVERTICAL

FLIPHORIZONTAL

FORCEGRID

GRIDINCREMENTS

HORIZSYM

IMPORT1D

IMAGEDISPLAYENABLE

IMAGEAUTORECALCENABLE

INITIALIZEMOVIE

INVERTSYM

LAMBDA

LENGTH

LINEARSCALE

LOGSCALE

MAKE3DIMAGE

MASK

MAXVALUE

MINVALUE

MULTIPLYSINTHETA

MULTIPLYSINTTHETA

NCONTOUR

NMASK

NMODELS

NUMSTATBINS

PIXELSIZE

PLAYMOVIE

PLOT

PRINT

QRANGE

READFILE

READIN

RECALCIMAGE

RESTOREDEFAULTIMAGEVALUES

RESTOREFITENVIRONMENT

RETRIEVEINSTRUMENTPARAMETERS

ROTATE

SAVEDATA

SAVEDATAASTIFF

SAVEFITENVIRONMENT

SAVEFITPARAMETERS

SAVE3DIMAGE

SAVEIMAGE

SAVEMOVIE

SAVEINSTRUMENTPARAMETERS

SAVEOVERLAY

SAVEPLOT

SAVEPLOTIMAGE

SAVESTATISTICS

SELECTREGION

SETANTIALIAS

SETCOSINEAB

SETINTENSITYEXPONENT

SETCOLOR

SETCONTOUR

SETFITPARAMETER

SETGRID

SETLINEWIDTH

SETMARKERINDEX

SETMARKERTYPE

SETMODEL

SETPLOTFONT

SETPLOTGRID

SETPLOTGRIDCOLOR

SETSTATBIN

SHOWEB

SHOWTEXT

SMOOTH

TWOTHETARANGE

TILT

VERTSYM

WAXSMODE

WRITEFILENAME

ZOOM

ZOOMCEN

2DFFT

Formats

String

Integer

Double

Boolean

Introduction and Overview

Datasqueeze provides an interface for running in a "batch" mode, otherwise known as "scripting" or "running from a file". The scripting file is a simple ascii file that can be created with any text editor. It should be raw text--that is, it should not contain any formatting commands (bold, etc.) such as those produced by Word or most other text editors. It is suggested that the file have a suffix .txt, since this will indicate to Windows and Macintosh systems that this is a plain text file, but in fact Datasqueeze itself doesn't care.

This feature is primarily useful if you want to process a number of data files in the same way, without visually examining each one. For example, you might want to read in a set of files, and for each one save a false-color image and an ascii version of the plot.

Each line starts with the > character followed by a keyword and some optional arguments. There are batch versions of most of the GUI-based actions. There are not batch versions of actions such as Examine which are intrinsically interactive.

Although the examples given in this help file employ numbers in the American format (e.g., 1,234.56) the number format should reflect whatever language you have chosen as your preference on your computer.

A short script might consist of something like the following:

>READFILE 0  "myfile.raw" "Bruker-Siemens" 
>SAVEIMAGE "myfile.jpg" JPEG
>BEAMCEN 497.0 519.0
>RECALCIMAGE 
>PLOT false false false Q 0.01 0.092 0.0010 CHI 3.0 170.0
>SAVEPLOT "myplot.txt" TAB
The first line tells the program to open the data file myfile.raw which is in Bruker-Siemens format. The second line tells it to save the false color image in jpeg format. The third line sets the center position. The fourth line redisplays the image. The fifth line sets up the parameters for a linear plot, and draws the plot. The last line saves the ascii data from that plot.

Once you have set up your data file, you can invoke it by clicking the Read From Command File menu item under Batch. Once the commands have been executed (or an error encountered) the program returns to graphical mode.

You can also create a log of the commands you run while in graphical mode by selecting Enable Logging Commands under the Batch file. The log will be continuously updated until you exit the program or select Disable Logging commands. It is suggested again that you give your file a .txt suffix.

The file thus created is identical in format to an input file for batch mode. Thus, you can create a sample template by running in graphical mode with logging turned on, and then edit that file to create a sequence of commands that will operate on many different files. In fact, this is the suggested way of creating such files, since otherwise it is hard to be sure that you have correctly specified the full path name for files appropriate to your system. You probably will, however, want to edit the log file before just running it, because otherwise it is likely to run somewhat slowly. For example, in graphical mode the image is redrawn every time some important change is made, such as zooming in or changing the center. This results in many time-consuming calls to RECALCIMAGE. When running in a batch or background mode you probably want to call this command at most once per file.

The remainder of this document gives a synopsis of each available command, in alphabetical order.

Commands

ADDMOVIEFRAME

Purpose:Add the current false color image to the buffer of movie frames.
Usage: > ADDMOVIEFRAME

APPENDTOFILE

Purpose:Enable or disable appending data on readin
Usage: > APPENDTOFILE tf
Parameters: tf (boolean): True append new data to current data
Example: > APPENDTOFILE true

APPLYFIT


Purpose:Apply least-squares model to plot without actually doing a fit
Usage: > APPLYFIT show_submodel
Parameters: show_submodel (boolean): True to show sub-models in plot
Example: >APPLYFIT true

APPLYMASK


Purpose:Apply masks that have just been defined
Usage: > APPLYMASK
Parameters: none
Example: >APPLYMASK

AXISRANGE


Purpose:Reset scale for a plot axis
Usage: >AXISRANGE axisname startval endval deltaval
Parameters: axisname (string): Name of axis (X or Y)
startval (double): Lower limit value
endval (double): Upper limit value
deltaval (double): Tick increment
Example: >AXISRANGE X 0.01 0.09 0.005
Comment: This command only makes sense after a call to PLOT.

AZIMUTH

Purpose:Set azimuth for detector tilt correction
Usage: >AZIMUTH az
Parameters: az (double): Angle of azimuth (in degrees)
Example: >AZIMUTH 82.3

BEAMCEN

Purpose:Set position of beam zero
Usage: >BEAMCEN xc yc
Parameters: xc (double): X-pixel of beam zero (may be fractional)
yc (double): Y-pixel of beam zero (may be fractional)
Example: >BEAMCEN 515.2 428.7

CALCSTATISTICS

Purpose:Calculate pixel statistics
Usage: > CALCSTATISTICS userranges
Parameters: userranges (boolean): True to use user-entered pixel ranges, false for default ranges
Example: > CALCSTATISTICS false
See also: The SELECTREGION command allows one to select the region of interest without doing a plot, while the PLOT command selects a region and also does the plot. One or the other should be called before the first call to CALCSTATISTICS.

CEN

Purpose:Set center of image
Usage: >CEN xc yc
Parameters: xc (double): X-pixel of image center (may be fractional)
yc (double): Y-pixel of image center (may be fractional)
Example: >CEN 515.2 428.7

CHIOFFSET

Purpose:Set the definition of chi=0 for azimuthal plots (useful for oriented patterns)
Usage: > CHIOFFSET val
Parameters: val (double): Set orientation of new equator in degrees
Example: > CHIOFFSET 39.7

COMMENT

Purpose:Comment in batch file--does nothing
Usage: > COMMENT
Parameters: none
Example: > COMMENT

CONDENSE

Purpose:Condense (rebin) image
Usage: > CONDENSE nxn
Parameters: nxn (integer): Pixels to combine into one (nxn x nxn)
Example: > CONDENSE 3

CONSTRUCTMODEL

Purpose:Construct fit model once submodels are defined
Usage: > CONSTRUCTMODEL
Parameters: none
Example: > CONSTRUCTMODEL

CONTRAST

Purpose:Set image contrast scale
Usage: > CONTRAST val
Parameters: val (double): Contrast: 4 >= val >= 0
Example: >CONTRAST 2.5

CONTOURSCALE

Purpose:Use Contours instead of false color image
Usage: > CONTOURSCALE
Parameters: none:
Example: > CONTOURSCALE

DETECTORAZIMUTH

Purpose:Set azimuth for detector 2theta rotation
Usage: >DETECTORAZIMUTH az
Parameters: az (double): Angle of azimuth (in degrees)
Example: >AZIMUTH 90.

DETECTORTWOTHETA

Purpose:Set detector arm 2 theta (waxs mode)
Usage: > DETECTORTWOTHETA tt
Parameters: de (double): Detector arm 2 theta (waxs mode) (in degrees)
Example: >DETECTORTWOTHETA 15.73

DEZING

Purpose:Clean up bad pixels
Usage: > DEZING
Parameters: none:
Example: >DEZING

DIAMETER

Purpose:Set detector diameter.
This is the side-to-side width of the detector, in cm,
not the diagonal span.
Usage: > DIAMETER da
Parameters: ra (double): Detector diameter in cm
Example: >DIAMETER 8.53

DOFIT

Purpose:Do least-squares fit of model to data
Usage: > DOFIT mpeb_set show_submodel
Parameters: mpeb_set (boolean): True to calculate multi-parameter error bars
show_submodel (boolean): True to show sub-models in plot
Example: > DOFIT false true

EXPORTPLOT

Purpose:Save plot data in one of several standard formats
Usage: > EXPORTPLOT filename format [anodetype]
Parameters: filename (string): Name of file, in quotes
format (string): File format; valid formats are
CPI, CSV, GSAS, PLV, DBWS, ASCIIPROFILE, or ASCII2COLUMN
anodetype (string): Anode type; allowed values are
Cu, Mo, Au, or Synch
Examples: > EXPORTPLOT "myplot.cpi" CPI Au
> EXPORTPLOT "myplot.csv" CSV

FILESWAP [DEPRECATED]

Purpose:This command no longer has any effect.

FITVSQ

Purpose:Force least squares fit to use Q as independent parameter even if plotting parameter was 2theta or q^2
Usage: > FITVSQ fq
Parameters: fq (boolean): True to force fit vs. Q, false to use plot variable
Example: >FITVSQ true

FLIPVERTICAL

Purpose:Reflect image about horizontal axis
Usage: > FLIPVERTICAL
Parameters: none
Example: >FLIPVERTICAL

FLIPHORIZONTAL

Purpose:Reflect image about vertical axis
Usage: > FLIPHORIZONTAL
Parameters: none
Example: >FLIPHORIZONTAL

FORCEGRID

Purpose:Force grid to use user-defined values
Usage: > FORCEGRID fg
Parameters: fg (boolean): True to use user-defined values for grid on the image, false for auto-selection
Example: >FORCEGRID true
See also: The GRIDINCREMENTS command sets the actual grid values that will be used. It should be called after FORCEGRID is set to true.

GRIDINCREMENTS

Purpose:Set steps for grid on top of false color image. Negative increments autoscale that variable
Usage: > GRIDINCREMENTS qdelta tthdelta chidelta qxdelta qydelta
Parameters: qdelta (double): Radial increment for q-chi polar grid
tthdelta (double): Radial increment for 2theta-chi polar grid
chidelta (double): Azimuthal increment for polar grid
qxdelta (double): Horizontal increment for cartesian grid
qydelta (double): Vertical increment for cartesian grid
Examples: >GRIDINCREMENTS 0.02 -1 5.0 -1 -1
>GRIDINCREMENTS -1 -1 5.0 0.025 0.025
See also: The FORCEGRID command determines whether the grid will be autoscaled or will use user-defined values. GRIDINCREMENTS has no effect unless preceded by FORCEGRID true.

HORIZSYM

Purpose:Fold the data so that the image has left-right symmetry about the beam center point.
Usage: > HORIZSYM

IMAGEDISPLAYENABLE

Purpose:Enable or disable display of false color image
Usage: > IMAGEDISPLAYENABLE truefalse
Parameters: truefalse (boolean): True to show image, false otherwise
Example: > IMAGEDISPLAYENABLE false

IMAGEAUTORECALCENABLE

Purpose:Enable or disable autorescale of false color image upon file open
Usage: > IMAGEAUTORECALCENABLE truefalse
Parameters: truefalse (boolean): True to autorescale image, false otherwise
Example: > IMAGEAUTORECALCENABLE false

IMPORT1D

Purpose:Import one-dimensional data
Usage: > IMPORT1D filename variable_name column_delimiter uncert xlog ylog [lambda] [nskip] [nread]
filename (string): Name of input file
variable_name (string): Name of independent variable: should be Q, Q^2, 2THETA, CHI, QX, or QY.
column_delimiter (string): Column delimiter: should be SPACE, TAB, or COMMA.
uncert (boolean): True if file includes a third column for data uncertainties, false otherwise
xlog (boolean): True if horizontal axis should be plotted on log scale, false otherwise
ylog (boolean): True if vertical axis should be plotted on log scale, false otherwise
lambda (double): Wavelength (angstroms)
nskip (integer): Number of lines at the beginning of the file to skip (default 0)
nread (integer): Total number of lines to read after the skipped lines (default entire file)
Example: >IMPORT1D "C:\sample data\input.txt" Q TAB true false false 1.54 2 75

INITIALIZEMOVIE

Purpose:Initialize a new movie of false color images.
Usage: > INITIALIZEMOVIE

INVERTSYM

Purpose:Fold the data so that the image has inversion symmetry about the beam center point.
Usage: > INVERTSYM

LAMBDA

Purpose:Set wavelength
Usage: > LAMBDA la
Parameters: la (double): Wavelength (angstroms)
Example: >LAMBDA 1.54

LENGTH

Purpose:Set sample-detector distance
Usage: > LENGTH le
Parameters: le (double): Sample-detector distance in cm
Example: >LENGTH 123.5

LINEARSCALE

Purpose:Set linear intensity scale for image
Usage: > LINEARSCALE
Parameters: none
Example: >LINEARSCALE

LOGSCALE

Purpose:Set logarithmic intensity scale for image
Usage: > LOGSCALE
Parameters: none
Example: > LOGSCALE

MAKE3DIMAGE

Purpose:Make 3D Image of the data
Usage: > MAKE3DIMAGE sz
Parameters: sz (integer): Size of image, in pixels. (512, 768, or 1024)
Example: > MAKE3DIMAGE 512

MASK

Purpose:Define a new mask
Usage: >MASK maskname index v1 [v2 v3 v4]
Parameters: maskname (string): Type of mask being defined. Should be one of MINXMASK, MINYMASK, MAXXMASK, MAXYMASK, ROWMASK, COLUMNMASK, PIXELMASK BOXMASK, INSIDECIRCLEMASK, OUTSIDECIRCLEMASK.
index (integer): Index of the mask being defined (0, 1, 2, ... up to NMASK)
v1, v2, v3, v4 (double): Values of parameters defining this mask (between 1 and 4 values)
Examples: >MASK MINXMASK 0 5
>MASK BOXMASK 6 255 176 823 954

MAXVALUE

Purpose:Set data value corresponding to maximum in color scale
Usage: > MAXVALUE maxval
Parameters: maxval (double): Maximum intensity
Example: >MAXVALUE 550.

MINVALUE

Purpose:Set data value corresponding to minimum in color scale
Usage: > MINVALUE minval
Parameters: minval (double): Minimum intensity
Example: > MINVALUE 2.7

MULTIPLYSINTHETA

Purpose:Enable or disable multiplication by the Lorentz factor sin(theta)
Usage: > MULTIPLYSINTHETA tf
Parameters: tf (boolean): True to multiply by sin(theta), false otherwise
Example: > MULTIPLYSINTHETA true

MULTIPLYSINTTHETA

Purpose:Enable or disable multiplication by the Lorentz factor sin(2 theta)
Usage: > MULTIPLYSINTTHETA tf
Parameters: tf (boolean): True to multiply by sin(2 theta), false otherwise
Example: > MULTIPLYSINTTHETA false

NCONTOUR

Purpose:Set number of contour lines to use
Usage: > NCONTOUR nc
Parameters: nc (integer): Number of contours, 20 >= nc >= 1
Example: > NCONTOUR 14

NMASK

Purpose:Set number of masks to use for data filtering
Usage: > NMASK nm
Parameters: nm (integer): Number of masks, nm >= 4
Example: > NMASK 7

NMODELS

Purpose:Set number of submodels to add for least-square fit
Usage: > NMODELS nm
Parameters: nm (integer): Number of models, 22 >= nm >= 1
Example: > NMODELS 3

NUMSTATBINS

Purpose:Set number of bins to use for statistics
Usage: > NUMSTATBINS bin_count
Parameters: bin_count (integer): Number of bins, 20 >= bin_count >= 1
Example: > NUMSTATBINS 15

PIXELSIZE

Purpose:Set pixel size
Usage: > PIXELSIZE pi
Parameters: ra (double): Pixel size in micrometers
Example: >PIXELSIZE 20.5

PLAYMOVIE

Purpose:Play movie of false color images.
Usage: > PLAYMOVIE [latency [ncycles]]
Parameters: latency (integer): Time between frames, in msec. Default value is 100; must be between 20 and 30000.
ncycles (integer): Number of times to play the movie. Default value is 5; must be between 1 and 32767.
Examples: >PLAYMOVIE 200 6
>PLAYMOVIE 50
>PLAYMOVIE

PLOT

Purpose:Make a 1D plot
Usage: > PLOT xlog ylog sum indvar mini maxi deltai consvar minc maxc [deltac [exponent]]
Parameters: xlog (boolean): True for logarithmic horizontal axis, false for linear axis
ylog (boolean): True for logarithmic vertical axis, false for linear axis
sum (boolean): True if we are to sum (or integrate) over pixels in range, false if we are to average over pixels
indvar (string): Name of variable over which we are to plot--possibilities are Q, CHI, TTHETA, QX, QY, or LINEX.
mini (double): Minimum value of independent variable
maxi (double): Maximum value of independent variable
delti (double): Plotting increment of independent variable
consvar (string): Name of variable over which we are to integrate --possibilities are Q, CHI, TTHETA, ELLIPSE, QX, QY, or LINEY
minc (double): Minimum value of constraint variable
maxc (double): Maximum value of constraint variable
delti (double): Plotting increment of independent variable--only used if plotting along a line or with ellipse
exponent (integer): Integer between zero and 4
Examples: >PLOT false false true Q 0.01 0.05 0.001 CHI 10 350
>PLOT true false false LINEX 563.0 755.0 0.01 LINEY 231.0 403.0 0.01
>PLOT false false true CHI 10 350 2.5 Q 0.01 0.05 0.001 2
>PLOT false false false CHI 0.000 360.000 2.500 ELLIPSE 1.244 1.474 1.480

PRINT

Purpose:Print a summary page
Usage: > PRINT printtype[usertext]
Parameters: printtype (string): Kind of printout we are making; choices are "SUMMARY", "IMAGE", or "PLOT"
usertext (string): User string, prepended to automatically generated information about this file
Examples: >PRINT IMAGE
> PRINT SUMMARY "T=250K, B=0.3 T\nSample 45"
Comment: This is not purely batch mode, since on most platforms a print command calls up a dialog box. So this command cannot be run in "unattended" mode. Linux/Unix printing not currently supported.

QRANGE

Purpose:Set q-scale for detector
Usage: > QRANGE qr
Parameters: qr (double): Maximum horizontal extent of detector in inverse angstroms
Example: >QRANGE 0.128

READFILE

Purpose:Read in a data file. Replaces READIN command.
Usage: >READFILE filenumber filename [dettype usefilecalib addval multval imno]
Parameters: filenumber (integer): which file in the list this is. If it is zero, any previous data in memory are overwritten. If it is greater than zero, the new data are added to previous data.
filename (string): full name of the file we are reading in, enclosed in quotes
dettype (string): name of detector type, enclosed in quotes
Currently supported types: "ADSC_Quantum", "Binary-little-endian", "Binary-big-endian", "CrysAlis", "Bruker-Siemens", "Bruker-Nonius KCD", "Ditabis IPC", "ESRF", "Esperanto", "Fuji_IP", "Gatan DM3", "GrayScale Image", "MAR_CCD", "MAR_IP (300)", "MAR_IP (345)"), "MAR_IP (PCK)", "Molecular Metrology", "Nonius DIP", "Rigaku_Raxis", "RaxisIV++" "Roper-Princeton", "SBIG", "Tiff", "XDR", "Unknown." The last one does its best to choose among the other available choices. If no name is specified, will attempt to use the last format used.
usefilecalib (boolean): true to use calibration parameters from file metadata, false to use user-determined values. Default is the value specified on the Calibration Parameter Source buttons on the File panel.
addval (double): quantity to add to each pixel, default 0
multval (double): quantity by which we should multiply each pixel, default 1
imno (integer): Image to select from within the file (default -1 adds them all up)
Examples: >READFILE 0 "C:\sample data\test.raw" "Bruker-Siemens" false 0.0 1.0 -1
>READFILE 1 "C:\sample data\test.raw" "Bruker-Siemens"
>READFILE 0 "C:\sample data\test.raw"

READIN (DEPRECATED)

Purpose:Read in a data file. Still works, but superceded by READFILE.
Usage: >READIN filenumber restore accstats filename dettype addval multval imno
Parameters: filenumber (integer): which file in the list this is. If it is zero, any previous data in memory are overwritten. If it is greater than zero, the new data are added to previous data.
restore (boolean): true if we are to keep same values for xcen, etc., as before, false if we are to use values from file
accstats (boolean): currently has no effect
filename (string): name of the file we are reading in, enclosed in quotes
dettype (string): name of detector type, enclosed in quotes
Currently supported types: "ADSC_Quantum", "Binary-little-endian", "Binary-big-endian", "CrysAlis", "Bruker-Siemens", "Bruker-Nonius KCD", "Ditabis IPC", "ESRF", "Fuji_IP", "Gatan DM3", "GrayScale Image", "MAR_CCD", "MAR_IP (300)", "MAR_IP (345)"), "MAR_IP (PCK)", "Molecular Metrology", "Nonius DIP", "Rigaku_Raxis", "RaxisIV++" "Roper-Princeton", "SBIG", "Tiff", "XDR", "Unknown." The last one does its best to choose among the other available choices.
addval (double): quantity to add to each pixel
multval (double): quantity by which we should multiply each pixel
imno (integer): Image to select from within the file (default -1 adds them all up)
Example: >READIN 0 false false "C:\sample data\test.raw" "Bruker-Siemens" 0.0 1.0 -1

RECALCIMAGE

Purpose:Force recalculation of image from possibly changed data
Usage: > RECALCIMAGE
Parameters: none
Example: >RECALCIMAGE

RESTOREDEFAULTIMAGEVALUES

Purpose:Restore false color settings to default values
Usage: > RESTOREDEFAULTIMAGEVALUES

RESTOREFITENVIRONMENT

Purpose:Restore saved fit environment
Usage: > RESTOREFITENVIRONMENT filename
Parameters: filename (string): Name of file, in quotes
Example: >RESTOREFITENVIRONMENT "fitenvironment.txt"

RETRIEVEINSTRUMENTPARAMETERS

Purpose:Retrieve (import) calibration parameters saved in file
Usage: > RETRIEVEINSTRUMENTPARAMETERS filename
Parameters: filename (string): Name of file, in quotes
Example: >RETRIEVEINSTRUMENTPARAMETERS "parameters.txt"

ROTATE

Purpose:Rotate image 90 degrees
Usage: > ROTATE
Parameters: none
Example: >ROTATE

SAVEDATA

Purpose:Save 2D data in an ascii file
Usage: > SAVEDATA filename separator
Parameters: filename (string): Name of file, in quotes
separator (string): Separator between columns: valid separators are
TAB, COMMA, or SPACE
Example: > SAVEDATA "mydata.txt" TAB

SAVEDATAASTIFF

Purpose:Save 2D data in a tiff file
Usage: > SAVEDATAASTIFF filename
Parameters: filename (string): Name of file, in quotes
Example: > SAVEDATAASTIFF "mydata.tif"

SAVEFITENVIRONMENT

Purpose:Save current fit environment
Usage: > SAVEFITENVIRONMENT filename
Parameters: filename (string): Name of file, in quotes
Example: > SAVEFITENVIRONMENT "fitenvironment.txt"

SAVEFITPARAMETERS

Purpose:Save fit parameters in an ascii file
Usage: > SAVEFITPARAMETERS filename rowcol
Parameters: filename (string): Name of file, in quotes
rowcol (boolean): True to save data with one row per parameter, false to save data with one column per parameter in plot
Example: > SAVEFITPARAMETERS "fitresults.txt" true
Comment: You should always call CONSTRUCTMODEL first, as it is not guaranteed that a model exists until you do this.

SAVE3DIMAGE

Purpose:Save pseudo-3D image
Usage: > SAVE3DIMAGE filename filetype
Parameters: filename (string): Name of file, in quotes
filetype (string): graphics format
Currently supported types: "JPEG", "PNG", "TIFF"
Example: >SAVE3DIMAGE "file.jpg" JPEG

SAVEIMAGE

Purpose:Save false color image in graphics format
Usage: > SAVEIMAGE filename filetype [resolution]
Parameters: filename (string): Name of file, in quotes
filetype (string): graphics format
Currently supported types: "JPEG", "PNG", "TIFF"
resolution (integer): Saved image will have
resolution x resolution pixels.
Default set by "Saved Image Resolution" button
Examples: >SAVEIMAGE "file.jpg" JPEG
>SAVEIMAGE "file.jpg" TIFF 1024

SAVEINSTRUMENTPARAMETERS

Purpose:Save calibration parameters in file
Usage: > SAVEVEINSTRUMENTPARAMETERS filename
Parameters: filename (string): Name of file, in quotes
Example: >SAVEVEINSTRUMENTPARAMETERS "parameters.txt"

SAVEMOVIE

Purpose:Save movie as a .avi file
Usage: > PLAYMOVIE latency filename
Parameters: latency (integer): Time between frames, in msec. Default value is 100; must be between 20 and 30000.
filename (string): Name of file, in quotes
Example: >SAVEMOVIE 200 "movie.avi"

SAVEOVERLAY

Purpose:Save grid and selected region overlays when copying or writing image
Usage: > SAVEOVERLAY dosave
Parameters: dosave (boolean): True to save, false otherwise
Example: > SAVEOVERLAY true

SAVEPLOT

Purpose:Save plot data in an ascii file
Usage: > SAVEPLOT filename separator
Parameters: filename (string): Name of file, in quotes
separator (string): Separator between columns: valid separators are
TAB, COMMA, or SPACE
Example: > SAVEPLOT "myplot.txt" COMMA

SAVEPLOTIMAGE

Purpose:Save plot image in graphics format
Usage: > SAVEPLOTIMAGE filename filetype
Parameters: filename (string): Name of file, in quotes
filetype (string): graphics format
Currently supported types: "JPEG", "PNG", "TIFF"
Example: >SAVEPLOTIMAGE "file.jpg" JPEG

SAVESTATISTICS

Purpose:Save file statistics in an ascii file
Usage: > SAVESTATISTICS filename
Parameters: filename (string): Name of file, in quotes
Example: > SAVESTATISTICS "mystats.txt"
Comment: You should always call CALCSTATISTICS first, as SAVESTATISTICS is not guaranteed to bring them up to date.

SELECTREGION

Purpose:Select plotting region without doing plot
(Mostly in conjunction with statistics calculations).
Usage: > SELECTREGION indvar mini maxi consvar minc maxc
indvar (string): Name of variable over which we are to plot--possibilities are Q, CHI, TTHETA, QX, QY, or LINEX.
mini (double): Minimum value of independent variable
maxi (double): Maximum value of independent variable
consvar (string): Name of variable over which we are to integrate --possibilities are Q, CHI, TTHETA, QX, QY, or LINEY
minc (double): Minimum value of constraint variable
maxc (double): Maximum value of constraint variable
Example: > SELECTREGION Q 0.02 0.05 CHI 10 270

SETANTIALIAS

Purpose:Enable or disable antialiasing correction for line plots
Usage: > SETANTIALIAS ai
Parameters: ai (boolean): True for antialiasing (nicer but slow), false otherwise
Example: > SETANTIALIAS true

SETCOSINEAB

Purpose:Set parameters for polarization correction
Usage: > SETCOSINEAB ca cb
Parameters: ca (double): Value of A parameter
cb (double): Value of B parameter
Example: > SETCOSINEAB 0.5 0.25

SETINTENSITYEXPONENT

Purpose:Set exponent n for x^n * I plots
Usage: > SETINTENSITYEXPONENT exponent
Parameters: exponent (integer): Integer between zero and 4
Example: > SETINTENSITYEXPONENT 2

SETCOLOR

Purpose:Choose color scheme for false color image
Usage: > SETCOLOR ncolor
Parameters: ncolor (integer): Index of color chosen, 7 >= ncolor >= 0
Example: >SETCOLOR 3

SETCONTOUR

Purpose:Set fields for a particular contour line
Usage: > SETCONTOUR nc val redval greenval blueval
Parameters: nc (integer): Index of contour line to be updated, 20 >= nc >= 0
val (integer): Intensity associated with this contour line
redval (integer): Red component of the RGB composition of this color, 255 >= redval >= 0
greenval (integer): Green component of the RGB composition of this color, 255 >= greenval >= 0
blueval (integer): Blue component of the RGB composition of this color, 255 >= blueval >= 0
Example: > SETCONTOUR 3 237 0 125 253

SETFITPARAMETER

Purpose:Set value and fitting status for a fit parameter
Usage: > SETFITPARAMETER model_number parameter_number allow_fit [value]
Parameters: model_number (integer): Which fit model this parameter this goes with, 6 >= model_number >= 1
parameter_number (integer): Which parameter within the model, typically, 3 >= parameter_number >= 1
allow_fit (boolean): Whether this parameter should be allowed to vary (true to vary)
value (double): New value of this parameter
Examples: > SETFITPARAMETER 1 2 true
> SETFITPARAMETER 2 1 false 45.23

SETGRID

Purpose:Determine type of grid to put on image
Usage: > SETGRID gridtype
Parameters: gridtype (string): Type of grid
Currently supported types: "NONE", "Q-CHI", "2THETA-CHI", "QX-QY"
Example: >SETGRID Q-CHI

SETLINEWIDTH

Purpose:Set width of lines in plot
Usage: > SETLINEWIDTH lw
Parameters: lw (double): Width of line, in pixels, 0.1 ≤ lw ≤ 10.0. Default is 1.0.
Example: >SETLINEWIDTH 2.5

SETMARKERINDEX

Purpose:Set index corresponding to size of marker in plots
Usage: > SETMARKERINDEX index
Parameters: index (integer): Which choice of radius.
Possible values are:
0 -- Auto
1 -- Line Only
2 -- Radius = 1.0
3 -- Radius = 1.5
4 -- Radius = 2.0
5 -- Radius = 2.5
6 -- Radius = 3.0
7 -- Radius = 3.5
8 -- Radius = 4.0
9 -- Radius = 4.5
10-- Radius = 5.0
Example: > SETMARKERINDEX 2

SETMARKERTYPE

Purpose:Set the type of marker used for plotting
Usage: >SETMARKERTYPE marker_type
Parameters: marker_type (string): Name of marker type, enclosed in quotes. Currently supported types "Filled Circles", "Open Circles", "Filled Squares", "Open Squares", "Filled Upwards Triangles", "Open Upwards Triangles", "Filled Downwards Triangles", "Open Downwards Triangles", "Filled Diamonds", "Open Diamonds", "Filled Pentagons", "Open Pentagons"
Example: > SETMARKERTYPE "Open Diamonds"

SETMODEL

Purpose:Set the kind of submodel we are using
Usage: >SETMODEL model_number model_name
Parameters: model_number (integer): which model in the list this is
(6 >= n_model >= 1)
model_name (string): Name of this parameter, enclosed in quotes. Currently supported models are "Polynomial"," Lorentzian", "Gaussian", "Voigt", "Lorentzian^2", "Power Law","Radius-Gyration", "Sine Wave", "Rayleigh", "Core-Shell", "Ellipsoid", "Cylinder", "ThinRod", "ThinDisk", "Gaussian Coil", "Fractal Aggregate", "Bessel", "Bessel^2", "Yarusso-Cooper", "Percus-Yevick", and "Kinning-Thomas".
Example: > SETMODEL 3 "Gaussian"

SETPLOTFONT

Purpose:Set the font used for plot labels
Usage: >SETPLOTFONT font size
Parameters: font (string): Name of desired font, in quotes
size (integer)): Pixel height of label font
Example: > SETPLOTFONT "Arial" 14

SETPLOTGRID

Purpose:Determines the grid overlay on linear plots
Usage: >SETPLOTGRID grid_type
Parameters: grid_type (string): Grid type: currently allowed values are NONE, COARSE, or FINE
Example: > SETPLOTGRID "FINE" 14

SETPLOTGRIDCOLOR

Purpose:Determines the color of plot grid
Usage: >SETPLOTGRIDCOLOR grid_color
Parameters: grid_color (string): Grid color: currently allowed values are GRAY (default), RED, GREEN, BLUE, ORANGE, CYAN, OR magenta
Example: > SETPLOTGRIDCOLOR "BLUE" 14

SETSTATBIN

Purpose:Set range for a particular statistics bin
Usage: > SETSTATBIN bin_number lowval highval
Parameters: bin_number (integer): Index of bin to be updated, 20 >= bin_number >= 0
lowval (integer): Low pixel counts for this bin
highval (integer): High pixel counts for this bin
Example: > SETSTATBIN 10 127 238

SHOWEB

Purpose:Enable or disable display of error bars in line plot
Usage: > SHOWEB eb
Parameters: eb (boolean): True to display error bars
Example: > SHOWEB true

SHOWTEXT

Purpose:Enable or disable display of text in line plot
Usage: > SHOWTEXT st
Parameters: st (boolean): True to display text
Example: > SHOWTEXT true

SMOOTH

Purpose:Smooth data
Usage: > SMOOTH
Parameters: none
Example: >SMOOTH

TILT

Purpose:Set tilt for detector tilt correction
Usage: > TILT ti
Parameters: ti (double): Tilt of detector away from normal to beam (in degrees)
Example: >TILT 4.7

TWOTHETARANGE

Purpose:Set maximum detector 2theta
Usage: > TWOTHETARANGE de
Parameters: de (double): Set 2theta at maximum horizontal extent of detector (in degrees)
Example: >TWOTHETARANGE 0.235

VERTSYM

Purpose:Fold the data so that the image has top-bottom symmetry about the beam center point.
Usage: > VERTSYM

WAXSMODE

Purpose:Enable or disable wide angle mode
Usage: > WAXSMODE tf
Parameters: tf (boolean): True for wide-angle mode, false for small-angle mode
Example: > WAXSMODE true

WRITEFILENAME

Purpose:Write file name on the false color image
Usage: > WRITEFILENAME dowrite
Parameters: dowrite (boolean): True to write)
Example: >WRITEFILENAME true

ZOOM

Purpose:Zoom in to image
Usage: > ZOOM zv
Parameters: zv (integer ): Zoom value: must be -1 (zoom OUT 2), 1, 2, 4, 8, 16, or 32
Example: > ZOOM 2

ZOOMCEN

Purpose:Set pixel at center of zoomed-in image
Usage: >ZOOMCEN xc yc
Parameters: xc (double): X-pixel at center (may be fractional)
yc (double): Y-pixel at center (may be fractional)
Example: >ZOOMCEN 65.0 237

2DFFT

Purpose:Perform Fourier transform of data
Usage: > 2DFFT zv filter
Parameters: zv (integer ): Magnification: must be -1 (zoom OUT 2), 1, 2, 4, 8, 16, or 32
filter (String): Type of filter, should be one of "Hamming", "Pseudo-Lorentzian", "Gaussian", or "None"
Example: > 2DFFT 8 "Hamming"

Formats

String


String variables are used for things like filenames. If they contain any spaces they must be enclosed in quotes using the double-quote " character (not two single quotes). They must not contain the characters '>', '%', or '"'. They can however contain the newline character '\n' if it is not part of a file name.
Examples:
test.raw
"C:\sample data\test.raw"
"Descriptive material for printout.\nTwo lines."
Bad examples:
C:\sample data\test.raw
''test.raw'' (looks OK but was made with pairs of single quotes rather than double quotes)
"/users/junk->junk/"xxx"/test%3.dat" (includes multiple illegal characters)

Integer


Integer variables should have no commas or decimal points. Hexadecimal or octal variables are not supported. Examples:
1
1500
Bad examples:
1.0
1,500
0431
0ae15c6

Double

Double variables should have no commas. Decimal points or exponentials are optional. We use the American, rather than the European, convention for decimals, i.e. a full stop (".") rather than a comma (",").
Examples
1.0
1.0e+03
5
Bad examples:
1,000

Boolean

Boolean variables express things that are either true or false. They should be represented either by the word "true" (without quotes) or the word "false". Upper case is allowable. Any word other than "true" is assumed to represent "false."