3.1. - Introduction
The standard macros included with the spec distribution are an integral part of the spec package. For some sites, the standard macros are sufficient for performing experiments. For others, the standard macros provide a starting point for custom development. This reference presents some of the standard macros, grouped by functionality. For many macros, the complete definition is printed. At the end of this reference, the construction of the scan macros is discussed in depth.
The following files, found in the macros subdirectory of the distribution, contain the definitions for all the macros in the standard library. If it is not obvious in which file a particular macro is stored, you can always change to the macros directory and type
grep macro_name *
,
where
grep
is the standard UNIX file searching utility.
File | Contents |
|
|
count.mac |
Counting macros (ct , uct , count , show_cnts , ... ). |
cplot.mac |
The cplot_plot macro. |
energy.mac |
For an energy-selecting monochromator (Escan , set_E , ... ). |
file.mac |
The newfile macro. |
getscan.mac |
The getscan macro. |
hkl.mac |
General reciprocal space macros (br , mk , ca , wh , ... ). |
motor.mac |
Motor moving and status (mv , umv , wa , set , set_lm , ... ). |
plot.mac |
Data plotting (plot , plot_res , rplot , splot , ansiplot , ... ). |
powder.mac |
Powder-mode macros (setpowder , _pmove and _pcount ). |
region.mac |
Macros to define a series of scans(setreg and doreg ). |
scans.mac |
Basic scan macros (ascan , a2scan , hklscan , ... ). |
scans1.mac |
Scan helper macros (_head , _loop , setscans , ... ). |
start.mac |
The startup macro. |
temper.mac |
Temperature control (settemp , measuretemp , te , ... ). |
util.mac |
Misc. utility macros (do , qdo , savmac , comment , u , help , ... ). |
|
|
fivec.src |
Fivec-circle geometry macros. |
fourc.src |
Four-circle geometry macros. |
sixc.src |
Sixc-circle geometry macros. |
spec.src |
Version for no diffractometer. |
surf.src |
Special liquid surface diffractometer macros. |
twoc.src |
Two-circle geometry macros. |
zaxis.src |
Z-axis geometry macros. |
When installed, the .mac files above are combined into one file and placed (assuming the default auxiliary file directory) in /usr/local/lib/spec.d/standard.mac. A file formed from the first four letters of the geometry configuration contains the geometry macros from one of the .src files above. For example, /usr/lib/spec.d/four.mac is created for the four-circle geometry and contains the macros from fourc.src.
The macro definitions are the least stable part of the spec package. The macros are easy to change -- no recompilation of C code is necessary -- and the intent of the designers of the spec package was to put its flexibility in the macros. Thus, the definitions presented below may differ with the macro definitions in your current version of spec.
You may find the existing macros do not accomplish what you want. A simple procedure for modifying a standard macro is to use the macro
savmac
to copy the definition of the existing macro into a file.
You then edit the macro definition in that file and read it back
in using the
do
macro.
You can gather your customized macros
into a file named
spec.mac
in your current directory or into the file
/usr/lib/spec.d/site.mac.
Both of these files are read every time you start spec,
whether or not you are starting fresh.
If you have made generally useful modifications to the standard macros, or if you have developed your own macros, please send copies to Certified Scientific Software. We include many user-contributed macros in each new release of the spec package.