Help for 'plot1' program.

Date help created:  06 Sep 1994
Date last updated:  22 Feb 1999
'plot1' is used to process and plot 1-dimensional data from n-dimensional data sets.

The graphical interface is Motif/X11.

To run the program type

	plot1 <plot1 script file>

The script file is mandatory and is similar to the command script files used in the program process.

Some of the commands in the script file are only interpreted once, at start up.

For a complete list of commands, type

	plot1 help commands

For details on syntax, and some typical examples, type

	plot1 help scripts

An auxiliary file, .plot1, is created when the parameters are saved on exit. Generally this file should not be edited.

Each button of the toplevel window pops up a module with functionality as briefly specified below.

NOTE: with the Motif Widow Manager (MWM) (the default for Silicon Graphics machines) a parent window cannot ever be raised above any of its child windows. This can be annoying (sorry, but hey, it's not my fault).

Since the interface is Motif, the program may not work as well with non-MWM window managers. And color is important but reasonable results are obtainable in black and white.

Each module (except the display) has a help button, which explains the available fuctionality in more detail. The general format is that there is a listing of features as seen on the screen, each being inside curly braces {}. Further HTML references are given in square braces [].

Generally, changing parameters leads to no change in the displays until an {apply} button is hit. The exceptions to this rule are explicitly noted.

{display}
The display. This is visible at start up. More details are given below.

{region}
Specifies the region for the display. [plot1/region]

{objects}
There are three of these modules. The first lists the data sets (plots) of the script, and specifies which of these are visible. The second specifies the color of the data sets (plots), and the third specifies the visibility and color of the various non- data-set objects that can be displayed. The latter are:
	crosshair
	x ruler
	y ruler
	x axis
	y axis
[plot1/data, plot1/object, plot1/property]

{sliders}
The sliders that have been set up in the script. [plot1/slider]

{buttons}
The buttons that have been set up in the script. [plot1/button]

{texts}
The texts that have been set up in the script. [plot1/text]

{output}
The plots can be output to a file in various formats. Currently this means PS, EPS and HPGL. [plot1/output]

{quit}
Quit the program, with the option of saving all the parameters (e.g. x axis color) as they are currently set.

{help}
Display this message.
Now a description of the display functionality:

The mouse can be used to carry out various manipulations.

The display can be resized in the usual way available for the particular window manager being used (e.g. the Motif Window Manager (MWM) uses the left button held down on the border, other window managers may use the middle button).

All three mouse buttons are used by this display.

The left and right arrow keys can be used to create a limiting range for the slice. A limiting range is defined even if only one of the limits is defined. (In this case the other limit takes the obvious value.) This can be used if the statistics of a particular sub-region is desired (see the help for the region module). It can also be used to expand/contract the chosen range.

If (stress on the word if) a limiting range has been created then the following button presses cause the given actions. If the left mouse button is pressed inside the limits, then the inside of the limits expands to fill the display. If the left mouse button is pressed outside the limits, then the display contracts to fit inside the limits. If the middle button is pressed the limits disappear.

Clicking the right button on the display provides the values of the data sets at that particular point.

The up and down arrow keys scale the y axis range up and down by a factor of about 1.4.

commands

The following is the complete list of script commands that are available in 'plot1'.

The commands are grouped (approximately) according to function:

Syntax and more details about <command> (where <command> is any of the above commands) can be obtained by typing

	plot1 help <command>

Read the source code to determine the exact algorithm implemented.

scripts

'plot1' needs a script file specified in order to run. Thus, to start 'plot1', type

	plot1 <plot1 script file>

Each script file has a list of commands, with one command per line. The general syntax of a command line can take one of four forms:

	<var> = <command> <argument 1> ... <argument n>
	<var> = <command> <argument 2> ... <argument n>
	<command> <argument 1> ... <argument n>
	<command> <argument 2> ... <argument n>

If <var> or <argument 1> are missing then it is assumed that the default variable ('x') is meant to be used instead. Not all commands (e.g. 'plot_y') have a <var>, i.e. there is no output. The stream-lined versions of the command lines allow for much tidier script files.

Note, that constant (i.e. non-variable) strings may either be surrounded by quotation (") marks or not, according to taste, except that if there is white space in the string, then quotation marks must be used.

Note also that currently the only data files that can be read are those associated with 'par' files.

A sample script file follows.

Assume there is a 2D experiment, with 'par' file 'expt.bin.par'. The following script sets up a button to quickly step through the different t1 (d2) experiments, and plots the real and imaginary parts of the t2 (d1) Fourier transforms. The real part is plotted in black and the imaginary is plotted in red. Buttons for the 'conv_sine' half width and the 'zerofill' value, and a slider for the 'phase' phase0 value, are also set up.

	t1 = button 1 "expt"	! button has initial value 1
	array 0 t1	! set up array with value t1 in d2
			! the value in d1 is not important
	read_par 1 expt.bin.par	! read par file in d1 dirn
	complex		! data is complex

	n = button 8 "half width"	! button for conv_sine
	conv_sine n	! convolution using sine

	n = button 1 "zero fill"	! button for zerofill
	zerofill n	! zerofill

	fft		! Fourier transform

	ph0 = slider -90 0 90 "phase0"	! slider with initial
				! value 0 and range -90 to 90
	phase ph0 0	! phase

	plot_y "real"		! plot real part of data

	exchange	! exchange real and imaginary
	color Red	! set the color to be red
			! this could also be done inside 'plot1'
	plot_y "imaginary"	! plot real part, which is
			! imaginary part of original data

complex

<var> = complex <x>

	If <x> is complex this command just sets <var> = <x>.
	If <x> is real this sets the real part of <var> equal to
	the odd point(s) of <x>, and the imaginary part of <var>
	equal to the even point(s).
	<x> must be an array.
	[ source code = complex.c ]

real

<var> = real <x>

	If <x> is real this just sets <var> = <x>.
	If <x> is complex this sets the odd point(s) of <var>
	equal to the real part of <x>, and the even point(s) to
	the imaginary part of <var>.
	<x> must be an array.
	[ source code = complex.c ]

complexify

<var> = complexify <x>

	This sets <var> = <x>.
	In particular the imaginary part of <var> is 0.
	<x> must be a real array.
	[ source code = complex.c ]

reduce

<var> = reduce <x>

	This sets <var> = real part of <x>.
	<x> must be a complex array.
	[ source code = complex.c ]

exchange

<var> = exchange <x>

	This sets real part of <var> = imaginary part of <x>,
	and imaginary part of <var> = real part of <x>.
	<x> must be a complex array.
	[ source code = complex.c ]

conjugate

<var> = conjugate <x>

	This sets real part of <var> = real part of <x>,
	and imaginary part of <var> = - imaginary part of <x>.
	<x> must be a complex array.
	[ source code = complex.c ]

magnitude

<var> = magnitude <x>

	If <x> is real, this sets <var> = absolute value of <x>.
	If <x> is complex, this sets <var> = square root of sum
	of squares of real part of <x> and imaginary part of <x>.
	<x> can be a complex or real array.
	[ source code = complex.c ]

magnitude2

<var> = magnitude2 <x>

	If <x> is real, this sets <var> = square of <x>.
	If <x> is complex, this sets <var> = sum of squares
	of real part of <x> and imaginary part of <x>.
	<x> can be a complex or real array.
	[ source code = complex.c ]

lower

<var> = lower <x> <lower bound>

	This sets <var> = <x> shifted so that point 1 of <var> is
	point <lower bound> of <x>.  The points of <x> less than
	<lower bound> are discarded.
	<x> can be a real or complex array.
	If <x> is complex then <lower bound> must be given in
	terms of complex points.
	[ source code = arrange.c ]

upper

<var> = upper <x> <upper bound>

	This sets <var> = <x> truncated at point <upper bound>.
	The points of <x> more than <upper bound> are discarded.
	<x> can be a real or complex array.
	If <x> is complex then <upper bound> must be given in
	terms of complex points.
	[ source code = arrange.c ]

range

<var> = range <x> <lower bound> <upper bound>

	This sets <var> = <x> shifted so that point 1 of <var> is
	point <lower bound> of <x>, and truncated at point
	<upper bound> of <x>.  The points of <x> less than
	<lower bound> or more than <upper bound> are discarded.
	<x> can be a real or complex array.
	If <x> is complex then <lower bound> and <upper bound>
	must be given in terms of complex points.
	[ source code = arrange.c ]

shift

<var> = shift <x> <shift amount>

	This sets <var> = <x> shifted so that point <shift amount>
	of <var> is point 1 of <x>.  The points of <var> less than
	<shift amount> are set to 0.
	<x> can be a real or complex array.
	If <x> is complex then <shift amount> must be given in
	terms of complex points.
	This shifts the data in the opposite direction to 'lower'.
	'shift' does not remove the points at the right, it makes
	the data longer.  Use 'upper' if it is desired to remove the
	points at the right.
	[ source code = arrange.c ]

cycle

<var> = cycle <x> <cycle amount>

	This sets <var> = <x> cycled by <cycle amount>.
	A <cycle amount> of 1 means that point 2 of <var> is
	equal to point 1 of <x>.
	A <cycle amount> of -1 means that point 1 of <var> is
	equal to point 2 of <x>.
	<x> can be a real or complex array.
	If <x> is <complex> then <cycle amount> must be given in
	terms of complex points.
	[ source code = arrange.c ]

reverse

<var> = reverse <x>

	This sets <var> = reverse of <x>.
	If <x> has n (complex/real) points then, for example,
	point 1 of <var> is set equal to point <n> of <x>,
	and point n of <var> is set equal to point 1 of <x>.
	<x> can be a complex or real array.
	[ source code = arrange.c ]

zerofill

<var> = zerofill <x> <n>

	This sets <var> = <x> but extended by 0, so that the size
	of <var> is 2 to the power <n> times the size of <x>
	(this is true independently of whether the size of <x> is
	itself a power of 2).  <n> must be between 0 and 4, inclusive.
	[ source code = arrange.c ]

scale

<var> = scale <x> <first point> <last point> <value>

	This sets <var> = <x> except in the range from
	<first point> to <last point>, when this sets
	<var> = <value> * <x>.
	<x> must be a real array, for complex <x> use 'scale2'.
	[ source code = arrange.c ]

scale2

<var> = scale2 <x> <first point> <last point> <real value> <imag. value>

	This sets <var> = <x> except in the range from
	<first point> to <last point>, when this sets
	<var> = (<real value> + i <imag. value>) * <x>.
	<x> must be a complex array, for real <x> use 'scale'.
	<first point> and <last point> must be specified
	in terms of complex points.
	[ source code = arrange.c ]

set

<var> = set <x> <first point> <last point> <value>

	This sets <var> = <x> except in the range from
	<first point> to <last point>, when this sets
	<var> = <value>.
	<x> must be a real array, for complex <x> use 'set2'.
	[ source code = arrange.c ]

set2

<var> = set2 <x> <first point> <last point> <real value> <imag. value>

	This sets <var> = <x> except in the range from
	<first point> to <last point>, when this sets
	<var> = <real value> + i <imag. value>.
	<x> must be a complex array, for real <x> use 'set'.
	<first point> and <last point> must be specified
	in terms of complex points.
	[ source code = arrange.c ]

mask_ppmm

<var> = mask_ppmm <x>

	This is the ++-- mask needed to process some Bruker data.
	Thus <var> = <x>, except that points 3 and 4, and all other
	points equivalent to these modulo 4, are multiplied by -1.
	<x> must be a real array.
	[ source code = arrange.c ]

mirror_zero

<var> = mirror_zero <x>

	This mirrors the data for zero dwell.  This means that <var>
	is constructed by extending <x> in negative time by complex
	conjugation and reversal, excluding the first point.
	<x> must be a complex array.
	[ source code = arrange.c ]

mirror_half

<var> = mirror_half <x>

	This mirrors the data for half dwell.  This means that <var>
	is constructed by extending <x> in negative time by complex
	conjugation and reversal, including the first point.
	<x> must be a complex array.
	[ source code = arrange.c ]

decay

<var> = decay <x> <end value>

	This sets <var> = <x> * decaying exponential.
	If <x> is of size n (complex/real) points, then the
	exponential is 1 at point 1 and <end value> at point n.
	<x> can be a complex or real array.
	See also decay_sw, which has more intuitive usage.
	[ source code = weight.c ]

decay_sw

<var> = decay_sw <x> <line broadening (Hz)> <spectral width (Hz)>

	This multiplies the data by a decaying exponential,
	exp(-pi*LB*t), where LB is the entered line broadening
	(in Hz).
	This function will provide a matched filter (=> best
	possible S/N ratio) for lines (or multiplets) that are
	LB Hz wide, and will increase all linewidths by LB Hz.
	The spectral width (SW) is needed by the program in order
	to translate between point number, x, and the time value,
	t, used in the function, by t = x/(2*SW).  If a value of
	SW=0.0 is given, the program uses the value for SW which
	was entered in the par file (or the default).
	[ source code = weight.c ]

gaussian

<var> = gaussian <x> <one fraction> <end value>

	This sets <var> = <x> * gaussian.
	If <x> is of size n (complex/real) points, then the
	gaussian is exp(a + b*x + c*x*x), where a, b and c are
	determined so that, the gaussian is 1, its maximum value, at
	point 1 + <one fraction>*(n-1) and <end value> at point n.
	<x> can be a complex or real array.
	See also gaussian_sw, which has more intuitive usage.
	[ source code = weight.c ]

gaussian_sw

<var> = gaussian_sw <x> <line broadening (Hz)> <sharpening factor> <spectral width (Hz)>

	This multiplies the data by the gaussian
	exp(a + b*t + c*t*t).  If LB is the entered line
	broadening (in Hz) and s is the sharpening factor, then
	a = -ln2 / s^2, b = pi*LB and c = - (pi*LB*s)^2 / 4ln2.
	Note that LB must be *positive* for normal use, which is
	the *opposite* of the Bruker convention.
	The function converts a Lorentzian line (or multiplet) of
	width FWWH equal to LB to a Gaussian line of width FWWH
	equal to s * LB.  The maximum value of the multiplying
	function is 1, which is obtained at the fraction of the
	acquired time t/T = 2ln2 / (LB*pi*T*s^2).
	The spectral width (SW) is needed by the program in order
	to translate between point number, x, and the time value,
	t, used in the function, by t = x/(2*SW).  If a value of
	SW=0.0 is given, the program uses the value for SW which
	was entered in the par file (or the default).
	The suggested range of values for s are from 1.3 to 0.7
	(possibly 0.5).  Relative S/N ratio after processing
	(with S/N after matched filter = 100%) are ca. 88% for
	s=1.3, 75% for s=1, 44% for s=0.7 and 13% for s=0.5.
	Note that values of s>1 can still be advantageous, as
	they improve the S/N and as the resulting Gaussian will
	have narrower 'feet' than the original Lorentzian.
	See Ernst, Bodenhausen and Wokaun, section 4.1.3.2, or
	Ernst, Adv. Mag. Reson. 2 (1996) p. 1.
	[ source code = weight.c ]

sinebell

<var> = sinebell <x> <angle>

	This sets <var> = <x> * sine function.
	If <x> is of size n (complex/real) points, then the
	sine function has angle <angle> (specified in degrees) at
	point 1, and angle 180 degrees at point n+1 (*not* point n).
	<x> can be a complex or real array.
	[ source code = weight.c ]

sinebell2

<var> = sinebell2 <x> <angle>

	This sets <var> = <x> * sine function squared.
	If <x> is of size n (complex/real) points, then the
	sine function squared has angle <angle> (specified in
	degrees) at point 1, and angle 180 degrees at point n+1
	(*not* point n).
	<x> can be a complex or real array.
	[ source code = weight.c ]

inv_cosine

<var> = inv_cosine <x> <frequency> <spectral width>

	This sets <var> = <x> * inverse cosine, where the inverse
	cosine is 1 / cos(d*x) (protected against dividing by 0),
	where d = 0.5 * PI * <frequency> / <spectral width>.
	<x> can be a complex or real array.
	[ source code = weight.c ]

weight_file

<var> = weight_file <x> <weight file>

	This sets <var> = <x> * function specified in <weight file>.
	If <x> is of size n (complex/real) points, then there must be
	n values in <weight file> (in free format).
	<x> can be a complex or real array.
	[ source code = weight.c ]

convolve

<var> = convolve <x> <half width>

	This does the same thing as conv_sine and is considered
	to be obsolete.

conv_sine

<var> = conv_sine <x> <half width>

	This sets <var> = <x> - <x> convolved with a sine function,
	using the given <half width>.
	Typically this is done on the acquisition
	fid before anything else is done, in order to remove a
	water signal that occurs at zero frequency.
	<x> can be a complex or real array.
	If <x> is complex the convolution is done separately on
	the real and imaginary parts of the data.
	[ source code = convolve.c and conv.c ]

conv_box

<var> = conv_box <x> <half width>

	This sets <var> = <x> - <x> convolved with a box function,
	using the given <half width>.
	Typically this is done on the acquisition
	fid before anything else is done, in order to remove a
	water signal that occurs at zero frequency.
	<x> can be a complex or real array.
	If <x> is complex the convolution is done separately on
	the real and imaginary parts of the data.
	[ source code = convolve.c and conv.c ]

conv_triangle

<var> = conv_triangle <x> <half width>

	This sets <var> = <x> - <x> convolved with a triangle
	function, using the given <half width>.
	Typically this is done on the acquisition
	fid before anything else is done, in order to remove a
	water signal that occurs at zero frequency.
	<x> can be a complex or real array.
	If <x> is complex the convolution is done separately on
	the real and imaginary parts of the data.
	[ source code = convolve.c and conv.c ]

conv_gaussian

<var> = conv_gaussian <x> <half width> <end value>

	This sets <var> = <x> - <x> convolved with a gaussian
	function, using the given <half width> and <end value>.
	Typically this is done on the acquisition
	fid before anything else is done, in order to remove a
	water signal that occurs at zero frequency.
	<x> can be a complex or real array.
	If <x> is complex the convolution is done separately on
	the real and imaginary parts of the data.
	[ source code = convolve.c and conv.c ]

conv_file

<var> = conv_file <x> <convolve file> <half width>

	This sets <var> = <x> - <x> convolved with the function
	specified in <convolve file>, using the given <half width>.
	Typically this is done on the acquisition
	fid before anything else is done, in order to remove a
	water signal that occurs at zero frequency.
	The convolution function is assumed to be 1 at the center
	and symmetric, thus only <half width> values need to be
	specified in the <convolve file>.
	<x> can be a complex or real array.
	If <x> is complex the convolution is done separately on
	the real and imaginary parts of the data.
	[ source code = convolve.c and conv.c ]

phase

<var> = phase <x> <phase0> <phase1>

	This sets <var> = <x> phased by <phase0> and <phase1>.
	<phase0> and <phase1> are both specified in degrees.
	(The pivot is assumed to be the first point.)
	<x> must be a complex array.
	[ source code = phase.c ]

phase2

<var> = phase2 <x> <phase0> <phase1> <pivot>

	This sets <var> = <x> phased by <phase0> and <phase1>,
	using the pivot <pivot> (the first point being point 1).
	<phase0> and <phase1> are both specified in degrees.
	<x> must be a complex array.
	[ source code = phase.c ]

fft

<var> = fft <x>

	This sets <var> = fft(<x>), where fft is a complex Fourier
	transform.  The size of <x> does not have to be a power of 2
	but if it is not the data is zero padded to the next one.
	<x> must be a complex array.
	[ source code = fft.c and ft.c ]

ifft

<var> = ifft <x>

	This sets <var> = ifft(<x>), where ifft is an inverse complex
	Fourier transform.  The size of <x> does not have to be a power
	of 2 but if it is not the data is zero padded to the next one.
	<x> must be a complex array.
	[ source code = fft.c and ft.c ]

rft

<var> = rft <x>

	This sets <var> = rft(<x>), where rft is a real Fourier
	transform.  The size of <x> does not have to be a power of 2
	but if it is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

irft

<var> = irft <x>

	This sets <var> = irft(<x>), where irft is an inverse real
	Fourier transform.  The size of <x> does not have to be a power
	of 2 but if it is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

cft

<var> = cft <x>

	This sets <var> = cft(<x>), where cft is a cosine Fourier
	transform.  The size of <x> does not have to be a power of 2
	but if it is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

icft

<var> = icft <x>

	This sets <var> = icft(<x>), where icft is an inverse cosine
	Fourier transform.  The size of <x> does not have to be a power
	of 2 but if it is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

sft

<var> = sft <x>

	This sets <var> = sft(<x>), where sft is a sine Fourier
	transform.  The size of <x> does not have to be a power of 2
	but if it is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

isft

<var> = isft <x>

	This sets <var> = isft(<x>), where isft is an inverse sine
	Fourier transform (the same as the sine Fourier transform).
	The size of <x> does not have to be a power of 2 but if it
	is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

hft

<var> = hft <x>

	This sets <var> = hft(<x>), where hft is a Hilbert Fourier
	transform.  The size of <x> does not have to be a power of 2
	but if it is not the data is zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

fftn

<var> = fftn <x>

	This sets <var> = fftn(<x>), where fftn is a normalised complex
	Fourier transform.  The size of <x> does not have to be a power
	of 2 but if it is not the data is zero padded to the next one.
	<x> must be a complex array.
	[ source code = fft.c and ft.c ]

ifftn

<var> = ifftn <x>

	This sets <var> = ifftn(<x>), where ifftn is a normalised
	inverse complex Fourier transform.  The size of <x> does not
	have to be a power of 2 but if it is not the data is zero
	padded to the next one.
	<x> must be a complex array.
	[ source code = fft.c and ft.c ]

rftn

<var> = rftn <x>

	This sets <var> = rftn(<x>), where rftn is an approximately
	normalised real Fourier transform.  The size of <x> does not
	have to be a power of 2 but if it is not the data is zero
	padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

irftn

<var> = irftn <x>

	This sets <var> = irftn(<x>), where irftn is an approximately
	normalised inverse real Fourier transform.  The size of <x>
	does not have to be a power of 2 but if it is not the data is
	zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

cftn

<var> = cftn <x>

	This sets <var> = cftn(<x>), where cftn is an approximately
	normalised cosine Fourier transform.  The size of <x> does not
	have to be a power of 2 but if it is not the data is zero
	padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

icftn

<var> = icftn <x>

	This sets <var> = icftn(<x>), where icft is an approximately
	normalised inverse cosine Fourier transform.  The size of <x>
	does not have to be a power of 2 but if it is not the data is
	zero padded to the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

sftn

<var> = sftn <x>

	This sets <var> = sftn(<x>), where sftn is a normalised sine
	Fourier transform.  The size of <x> does not have to be a
	power of 2 but if it is not the data is zero padded to the
	next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

isftn

<var> = isftn <x>

	This sets <var> = isftn(<x>), where isftn is a normalised
	inverse sine Fourier transform (the same as the normalised
	sine Fourier transform).  The size of <x> does not have to
	be a power of 2 but if it is not the data is zero padded to
	the next one.
	<x> must be a real array.
	[ source code = fft.c and ft.c ]

avance

<var> = avance <x> <DSPFVS> <DECIM>

	This does the first part of the transform required for
	Bruker Avance data, with specified <DSPFVS>, <DECIM>
	and angle 180 degrees.  This sets <var> = a left shift
	of <x> by a number of points calculated from <DSPFVS>
	and <DECIM>.
	For the second part of the transform use avance_phase,
	which is required in combination with this command.
	This command would normally be done before convolution
	or weighting.
	For angle not 180 use avance2.
	<x> must be a complex array.
	[ source code = avance.c and avance_param.c ]

avance2

<var> = avance2 <x> <DSPFVS> <DECIM> <angle>

	This does the first part of the transform required for
	Bruker Avance data, with specified <DSPFVS>, <DECIM>
	and <angle>.  This sets <var> = a left shift of <x> by
	a number of points calculated from <DSPFVS>, <DECIM>
	and <angle>.
	For the second part of the transform use avance_phase,
	which is required in combination with this command.
	This command would normally be done before convolution
	or weighting.
	For angle 180 use avance.
	<x> must be a complex array.
	[ source code = avance.c and avance_param.c ]

avance_phase

<var> = avance_phase <x>

	This does the second part of the transform required for
	Bruker Avance data.  This sets <var> = a phasing of <x>
	by piv = 1 and ph0 and ph1 calculated from the parameters
	as specified in avance or avance2, which must accompany
	this command.  This command would normally be done just
	after the Fourier transform and before the usual phasing,
	and it must be done inside the same script as the first
	part of the transform.
	<x> must be a complex array.
	[ source code = avance.c and avance_param.c ]

base_const

<var> = base_const <x> <half width>

	This fits the baseline of a spectrum (not fid) by first
	finding baseline points using a shifting window of size
	<half width> and then fitting a constant to those
	baseline points.
	<x> must be a real array.
	If base_points has been used to define the baseline
	then the <half width> is ignored.
	This command is equivalent to base_poly with degree 0.
	[ source code = baseline.c and base.c ]

base_const2

<var> = base_const2 <x> <half width> <first point> <last point>

	This fits the baseline of a spectrum (not fid) by first
	finding baseline points using a shifting window of size
	<half width> and then fitting a constant to those
	baseline points.
	Only the points from <first point> to <last point>
	(inclusive) are fitted.
	<x> must be a real array.
	If base_points has been used to define the baseline
	then the <half width> is ignored.
	This command is equivalent to base_poly2 with degree 0.
	[ source code = baseline.c and base.c ]

base_poly

<var> = base_poly <x> <half width> <degree>

	This fits the baseline of a spectrum (not fid) by first
	finding baseline points using a shifting window of size
	<half width> and then fitting a polynomial of degree
	(order) <degree> to those baseline points.
	(A line has degree 1, a parabola has degree 2, etc.)
	<x> must be a real array.
	If base_points has been used to define the baseline
	then the <half width> is ignored.
	If <degree> = 0 this command is equivalent to
	base_const.
	[ source code = baseline.c and base.c ]

base_poly2

<var> = base_poly2 <x> <half width> <degree> <first point> <last point>

	This fits the baseline of a spectrum (not fid) by first
	finding baseline points using a shifting window of size
	<half width> and then fitting a polynomial of degree
	(order) <degree> to those baseline points.
	(A line has degree 1, a parabola has degree 2, etc.)
	Only the points from <first point> to <last point>
	(inclusive) are fitted.
	<x> must be a real array.
	If base_points has been used to define the baseline
	then the <half width> is ignored.
	If <degree> = 0 this command is equivalent to
	base_const2.
	[ source code = baseline.c and base.c ]

base_trig

<var> = base_trig <x> <half width> <order>

	This fits the baseline of a spectrum (not fid) by first
	finding baseline points using a shifting window of size
	<half width> and then fitting trig functions of order
	<order> to those baseline points.  In fact, the number
	of functions used to do the fitting is 2*<order> + 1,
	the 2 being because cosines and sines are used,
	and the 1 being because a constant is also used.
	This fit only makes sense if the original data set
	contains the entire recorded spectral width.
	<x> must be a real array.
	If base_points has been used to define the baseline
	then the <half width> is ignored.
	If <order> = 0 this command is equivalent to
	base_const.
	[ source code = baseline.c and base.c ]

base_trig2

<var> = base_trig2 <x> <half width> <degree> <first point> <last point>

	This fits the baseline of a spectrum (not fid) by first
	finding baseline points using a shifting window of size
	<half width> and then fitting trig functions of order
	<order> to those baseline points.  In fact, the number
	of functions used to do the fitting is 2*<order> + 1,
	the 2 being because cosines and sines are used,
	and the 1 being because a constant is also used.
	This fit only makes sense if the original data set
	contains the entire recorded spectral width.
	Only the points from <first point> to <last point>
	(inclusive) are fitted.
	<x> must be a real array.
	If base_points has been used to define the baseline
	then the <half width> is ignored.
	If <order> = 0 this command is equivalent to
	base_const2.
	[ source code = baseline.c and base.c ]

base_points

base_points <x> <base points file>

	This uses the points in the <base points file> to
	define the baseline points for subsequent baseline
	correction routines (by default the baseline is
	determined automatically by the program).  There
	must be a matching end_base_points before the
	next use of base_points or before a resumption
	of the automatic baseline determination.
	<x> must be a real array and is just there to
	determine the number of points, which is used
	to check the validity of the point range in the
	<base points file> and at the time of baseline
	correction to check the consistency of the number
	of points with the array specified then.
	[ source code = baseline.c and base.c ]

end_base_points

end_base_points

	This matches the most recent base_points and must
	occur before the next use of base_points or before
	a resumption of automatic baseline determination
	(the default).
	[ source code = baseline.c ]

base_subtract

<var> = base_subtract <x> <base subtract file>

	This subtracts the values given in <base subtract file>
	from <x>.
	<x> must be a real array.
	If the size of <x> is n then there must be n values in
	<base subtract file> (in free format).
	[ source code = baseline.c ]

base_subtract2

<var> = base_subtract2 <x> <base subtract file> <first point> <last point>

	This subtracts the values given in <base subtract file>
	from <first point> to <last point> (inclusive) of <x>.
	<x> must be a real array.
	If n = <last point> - <first point> + 1, then there must
	n values in <base subtract file> (in free format).
	[ source code = baseline.c ]

add

<var> = add <x> <y>

	This sets <var> = <x> + <y>.
	<x> and/or <y> can be arrays and/or numbers.
	<x> and <y> can be real or complex.
	[ source code = arith.c ]

subtract

<var> = subtract <x> <y>

	This sets <var> = <x> - <y>.
	<x> and/or <y> can be arrays and/or numbers.
	<x> and <y> can be real or complex.
	[ source code = arith.c ]

multiply

<var> = multiply <x> <y>

	This sets <var> = <x> * <y>.
	<x> and/or <y> can be arrays and/or numbers.
	<x> and <y> can be real or complex.
	[ source code = arith.c ]

divide

<var> = divide <x> <y>

	This sets <var> = <x> / <y>.
	<x> and/or <y> can be arrays and/or numbers.
	<x> and <y> can be real or complex.
	[ source code = arith.c ]

number

<var> = number <x>

	This sets <var> = <x>.
	<x> must be a real number.
	As an example, 'x = number 3' sets x = 3.
	[ source code = assign.c ]

array

<var> = array <x1> <x2> ... <xN>

	This sets <var> to be the array which is the concatenation
	of the arrays and/or numbers <x1> through <xN> (N arbitrary).
	The <x1> to <xN> must be all real or all complex.
	The arguments <x1> to <xN> must all be given explictly (i.e.
	there is no shortened form allowed to the right of 'array').
	As an example, 'x = array a b 3' sets x = (a, b, 3).
	(This assumes that the variables a and b have been defined.)
	[ source code = assign.c ]

string

<var> = string <x>

	This sets <var> = <x>.
	<x> must be a string.
	As an example, 'file = string expt.bin.par' sets 'file' to
	be equal to the string 'expt.bin.par'.
	[ source code = assign.c ]

step

<var> = step <first> <last> <step>

	This creates an array whose first point is <first>, and
	whose remaining points are uniformly spaced by <step>,
	until <last> is reached (or as close as possible).
	<step> may be positive or negative (but not 0).
	As an example, 't = step 1 64 2' creates an array
	t = (1, 3, 5, ..., 61, 63).
	[ source code = assign.c ]

sin

<var> = sin <x>

	This sets <var> = sin(<x>).
	<x> must be a real array or number.
	[ source code = maths.c ]

cos

<var> = cos <x>

	This sets <var> = cos(<x>).
	<x> must be a real array or number.
	[ source code = maths.c ]

tan

<var> = tan <x>

	This sets <var> = tan(<x>).
	<x> must be a real array or number.
	[ source code = maths.c ]

exp

<var> = exp <x>

	This sets <var> = exp(<x>).
	<x> can be a real or complex array or number.
	[ source code = maths.c ]

button

<var> = button <initial value> <label>

	This creates a button, <var>, with specified
	<initial value> and <label>.
	The <inital value> must be a real number.
	The <label> must be a string.
	As an example, 'n = button 8 "half width"' sets up
	a button with initial value 8.
	[ source code = button.c ]

slider

<var> = slider <min range> <initial value> <max range> <label>

	This creates a slider, <var>, with specified
	<initial value>, range <min range> to <max range>, and
	<label>.  The <inital value>, <min range> and <max range>
	must all be real numbers.  The <label> must be a string.
	As an example, 'ph0 = slider -90 0 90 "phase0"' sets
	up a slider with initial value 0 and range (-90, 90).
	[ source code = slider.c ]

text

<var> = text <initial value> <label>

	This creates a text, <var>, with specified
	<initial value> and <label>.
	The <inital value> and the <label> must be strings.
	As an example, 'name = text expt.par "file name"'
	sets up a text with initial value "expt.par".
	[ source code = text.c ]

include

include <file>

	This reads and interprets the <file> before continuing
	the processing of the current script file.
	<file> must be a constant string, it may not be a variable.
	[ source code = script.c ]

plot_y

plot_y <y> <label>

	This does and x, y plot with specified <y> and with <x>
	set to the array (1, ..., N), where N is the size of <y>.
	[ source code = plots.c ]

read_par

<var> = read_par <point> <dim> <par file>

	This reads the 1-dimensional array through <point> in
	the direction <dim>, for the data set specified in the
	<par file>.
	<point> must be a real array.  <dim> must be a real number.
	<par file> must be a string.
	This reference is used in subsequent plotting commands
	until the next read_par or set_reference commands.
	[ source code = input.c ]

set_reference

<var> = set_reference <sw> <sf> <refppm> <refpt>

	This sets the (current) reference to have the stated values.
	<sw>, <sf>, <refppm> and <refpt> must be real numbers.
	Here <sw> is the spectral width in Hz, <sf> is the
	spectrometer frequency in MHz, <refppm> is the reference
	point ppm value, and <refpt> is the reference point.
	This reference is used in subsequent plotting commands
	until the next read_par or set_reference commands.
	[ source code = input.c and input_ref.c ]

color

color <name>

	This sets the current color to be <name>.
	Currently, <name> must be one of 'Black', 'Red', 'Green',
	'Blue', 'Yellow', 'Purple' or 'Cyan'.
	This command is only processed at start up, after this
	the color is as specified in the 'objects' module.
	[ source code = object.c ]

x_offset

x_offset <offset>

	This sets the current x offset to be <offset>.
	This means that the plots defined after this command
	are shifted in the x direction by <offset> (points).
	<offset> must be a real number.
	[ source code = object.c ]

y_offset

y_offset <offset>

	This sets the current y offset to be <offset>.
	This means that the plots defined after this command
	are shifted in the y direction by <offset>.
	<offset> must be a real number.
	[ source code = object.c ]

x_scale

x_scale <scale>

	This sets the current x scale to be <scale>.
	This means that the plots defined after this command
	are scaled in the x direction by <scale>.
	<scale> must be a real number.
	[ source code = object.c ]

y_scale

y_scale <scale>

	This sets the current y scale to be <scale>.
	This means that the plots defined after this command
	are scaled in the y direction by <scale>.
	<scale> must be a real number.
	[ source code = object.c ]

Azara help: plot1 / W. Boucher / azara@bioc.cam.ac.uk