Units()

Convert the units of a Time of Flight workspace as specified

UNITS() wksp=Workspace [xmin=Real] [xmax=Real] Convert workspace units
[/C] or [/Channel] To Channel numbers (one way)
[/D] To D-Spacing (A)
[/E] To Energy (meV)
[/LAM] To Wavelength (A)
[/Q] To Momentum Transfer (A-1)
[/SQ] To (Momentum Transfer)2 (A-2)
[/T] To Time of Flight (us)
[/LA1] To primary flight path wavelength (A)
[/W] To energy transfer E1-E2 (meV)
[/WN] To energy transfer E1-E2 (cm-1)
[/TAU] To reciprocal time-of-flight (us/m)

example:

	# Read in a spectrum whilst converting to Wavelength
	>> w = units:Lam( s(1) )

Note: TOF Parameters must be set correctly in the workspace (or set Set/Par).

Units

The Units() command provides for units conversion of Time-of-Flight spectra. The conversions usually rely on specific parameters being set correctly in the input workspace. These may be read in correctly from the data file, or they may have to be set in the workspace before the Units() command is carried out. To find the parameters see the section on workspace operations.

A good way of ensuring parameters are read correctly is to overload the S() command, see Alias() and the example given for overriding the Focus() command.

Parameters:

Wksp (Workspace)

The Time-of-Flight workspace to convert.

Xmin, Xmax (Real) [default = converted spectra minimum & maximum respectively]

Optional interval to select the section of the workspace to convert (specified in the final units). For energy only, the default is 1000-5000meV.

RESULT = (Workspace)

The converted workspace. If the keyword syntax is used, the workspace will be converted destructively (e.g. Units/C w).