At some point, you'll probably want to get information about Program Variables, Paths, and other aspects of IFEFFIT's state. The most basic way to do this is with the show() command.
The show command will print out information about the program variables, fitting variables, paths, macros, color table, and built-in commands. In it's simplest form, show() will print the value and, if appropriate the formula, for a program variable. For scalars, show() works like this:
Ifeffit> a = 8, x = 9 / a
Ifeffit> show a, x
a = 8.00000000
x = 1.12500000 := 9/a
Note that both the value and formula are shown for x. For text
strings, the results are pretty straightforward - there's no stored
formula, so the string is simply printed.
Ifeffit> $string = ' My favorite string '
Ifeffit> show $string
My favorite string
For arrays, however, the results are a little different. Since it's
unlikely you'll want to see every element of an array (and if you do,
there's always print()), so the number of points, maximum, minimum
values, and if appropriate the formula are printed:
Ifeffit> my.x = indarr(10)/3
Ifeffit> show my.x
my.x = 10 pts [ 0.33333 : 3.3333 ] := indarr(10)/3
To see the contents of a pre-defined macro, just tell the show()
command the macro name:
Ifeffit> show make_ps
macro make_ps ifeffit.ps /cps
"dump plot to a postscript file"
plot(device=$2, file= $1)
end macro
The arguments to show() can be of mixed type - you can show scalars,
strings, arrays, and macros with a single command. If a program variable
is not known, an `undefined variable' will be printed.
Beyond these simple examples, show() can also print out classes of program variables, using the special @ symbol. That is, to get a listing of all the scalars (with values and definitions, if appropriate), type show @scalars. Similarly, show @arrays and show @strings will show all the arrays and strings, respectively. The listing shown for scalars and arrays will be sorted with ``most constant'' (i.e., those values that were set()) at the top, and the ``least constant'' (i.e., those that depend on other variables) at the bottom. This means the listing is subject to re-ordering at any time.
All the fitting variables can be shown with show @variables: both the current value (which would be the initial value before a fit and best-fit value after a fit) and estimated uncertainty will be shown. show @colors will print out the plotting color table (discussed in section 5.3). show @macros will print out all the macro names, with description and default arguments, but won't print out the full text for each macro. You can say show @macro = make_ps or just show make_ps to see the full contents of a macro.
For XAFS paths defined with the path() command, show @paths will list the values of all the path parameters for all paths. To get a listing for a limited selection of paths, show @path = 1 or show @path = 1,2,5 will show just those paths.
In addition to the show() command, you can also print out messages with the echo() and print() commands. echo() simply prints its argument, which is of limited utility at the command line, but is often helpful in more complicated scripts:
Ifeffit> echo(" I am in macro BKG, about to write outputs")
I am in macro BKG, about to write outputs
Ifeffit> echo " t"
t
print(), on the other hand, is a more general purpose printing
command, interpreting its arguments as strings or mathematical expressions
where appropriate, and printing out the resulting values. For
example,
Ifeffit> print pi 3.141593You can print out more than one value at a time, and even print out the value of expressions, making print() act like a simple calculator:
Ifeffit> var = 100.
Ifeffit> $string = 'This is a string'
Ifeffit> print pi/2 sqrt(5*var) $string
1.570796 22.36068 This is a string
print() does a mediocre job of parsing, so it is best to enclose
expressions in quotes or double quotes. Enclosing in single and double
quotes have different results, though. Double quotes cause evaluation,
while single quotes prevents evaluation, so the string is written
out literally. That is, you can say something like this.
Ifeffit>print 'x , sqrt(x) = ' ," x ", " sqrt(x) / 2 "
x , sqrt(x) = 10.22000 1.598437
Ifeffit>print ' Rbkg = ', rbkg, ' Ang '
Rbkg = 1.2000000 Ang
Finally, unlike show(), print() will print out all elements of an
array. I won't give an example of that - you can try it for yourself.