Focus()

Focus a range of spectra with given parameters

FOCUS() spectra=Range or IntegerArray [file=String] [detpars=Workspace] [specpars=Workspace] Focus a set of TOF spectra correcting for detector efficiency.
[:D] Convert to D-spacing before summing
[:Q] Convert to momentum transfer before summing
[:T] Sum in time of flight
[:VERBOSE] print out TOF parameters used in conversions

example:

	# Focus a time of flight spectrum in D-spacing
	# get the TOF parameters from the raw data file
	>> w = focus( 1:17, "irs12838.raw" )
	# Focus default file, every third period
	>> assign 3045
	>> refl = focus( 3:90@3, _, mydet )

Note: Focussing is done in D-spacing by default.


Focus

This command provides for focussing groups of neutron time of flight spectra from detectors at different scattering angles. This command, although written specifically for focussing multiple banks of detectors consecutively can be used for single scanning detectors data as long as the data from consecutive runs has been stored as numbered spectra in a data format Open GENIE understands, for example an old GENIE-V2 intermediate file (see Supported File Formats). If the data has been stored in an Open GENIE intermediate file, the parameters can be stored in workspace format, see the example below.

If the detector efficiency parameters and/or T-O-F parameters are available from some other source, the Focus() command can be extended easily to read these parameters using the Alias() command as in the following example.

Example

	# First alias the focus command so we can still get at it
	alias "original_focus" "focus"
	# Now define a new FOCUS procedure which can
	# read the parameters from a convenient file.
	PROCEDURE FOCUS
	    PARAMETERS SPECTRA FILE=String
	    QUALIFIERS /D /Q /T
	    RESULT res
	    LOCAL Tofpars Detpars
	    # read these from a convenient intermediate files, could also use
	    # the Asciifile() procedures to read any ASCII file format
	    Tofpars = get("PARS", "parms.in3")
	    Detpars = get("EFF", "detpars.in3")
	    IF Q; res = original_focus:q(spectra, file, detpars, tofpars); ENDIF
	    IF D; res = original_focus:d(spectra, file, detpars, tofpars); ENDIF
	    IF T; res = original_focus:t(spectra, file, detpars, tofpars); ENDIF
	ENDPROCEDURE

The new focus command can be used transparently in place of the original command.

Parameters:

/D, /Q, /T

Specify whether to focus in D-spacing, momentum transfer or by time.

Spectra (Range)

This parameter specifies the spectra to be focussed from the input file as a Range.

Open GENIE supports unique data types called Interval and Range, a Range or Interval can be used to specify a range of indices respectively to access multi-spectra data. For more information on specifying intervals, please see a description of the Interval syntax.

For the most general ability to specify a group of arbitrary spectra an Integer array of spectrum identifiers can be given as the the "Spectra" parameter.

File (String) [ default = default input file ]

The name of the input data file. This parameter will default to the default input file set by the Set/File/Input command if it is not specified.

Detpars (Workspace) [ default = no detector efficiency correction ]

Parameters for correcting for detector efficiency. These are given in a workspace with the following field names:

Field name Type Description
PRESSURE Real Gas pressure (atms)
GAS_SIGMA0 Real Gas cross section at lambda 0 (cm-2)
PATHLENGTH Real Gas path length (cm)
lWAVELENGTH Real Characteristic wavelength (cm)
WEIGHT Real Molecular weight of container atoms (g mol-1)
DENSITY Real Density of container (g cm-3)
THICKNESS Real Container wall thickness (cm)
WALL_SIGMA0 Real Wall cross section at LAM0 (cm-2)
TYPE String Detector description, eg "He3 gas"

Specpars (Workspace) [ default = values from raw file ]

Time of flight parameters. These are given in a workspace with the following field names:

Field name Type Description
TWOTHETA Realarray Two theta scattering angles per spectrum (degrees)
EMODE Integer mode 0=inelastic, 1=incident, 2=transmitted
EFIXED Real or Realarray Fixed energy value or values if EMODE=2
L1 Real Primary flight path (m)
L2 Realarray Secondary flight paths (m)

The arrays need to be of size "nspec" where "nspec" is the total number of spectra being focussed.

RESULT = (Restype)

The final focussed spectrum.

Jke.!uKWN(,l ձ/{M= @HaӡZP'N4HiP蔓Om4siGNNr;J2ϕ="/P|; j!^v8梶$ 0#4$pyj)rxiܡCr>Yyk{Kݬ1g]Y*ұkY|,at:W)E˘+N sPS{%$6U'zi/!!Ϻ,ILLDEE{="2r*$PC7"_L=>FlхBMnf,mQv=2 |mxfwP}{9hy`)DNX.vPu1}.-X˯%AVl"-X| +'X'l13% TUpY0ek4skpĆ2K&iw!S9^]1lk+DղD\Q=3+$v{/m*#4+Z=; b[Y馂qC>0f(JeZԯnٯ*op7UTK D&LZ| ߵ4Kԕb r!|{S7\jAf+w{ߡq6?rwAm@}v @梒K!}?}ݗqR7ut&KՕ/>kSꖾB=s|SտvW#꾼7?o/Gulg]|~>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