Spectrum Analysis

X-window based Analysis Package for Nuclear Spectroscopy Data.

By

Gerfried Kumbartzki

Where to find XSA

The XSA distribution (Download) is available as a compressed tar archive. The compilation of XSA requires the Motif 1.2 toolkit.
Under LINUX or Mac OS X openmotif-2.1.30 or higher works fine.

Overview

XSA is a program to manipulate and analyze 1-dim. histogram data sets, called Spectra.
2dim. data sets, Matrixes, can be read, and a number of operations may be performed (e.g. making cuts, projections).

XSA has two major modes:
command or text mode Command Window
cross-hair or cursor mode Graphics Window

The user can move freely between the two windows. Clicking the left mouse button in the corresponding window switches input focus. In the command window command lines can be recalled, edited and re-issued. In the graphics window key-press and button-press events are used to manipulate the picture.

XSA creates log-files, like "saMMDDYY_time.dat","results.dat" (appends to existing logfile), to record useful information and results.

Data (Spectra)

Data are read from a File. An XSA-File requires a special File header. For compatibility Radware (.spe) and ASCII-array (.asc) data files are accepted.

XSA can be called to use shared memory for its data space ("xsa -s"). The shared memory segment has to be initialized with the program shm_init (which is part of the distribution). For 'online' applications the shared memory segment can be filled by a separate histogram process.

      Total data space available   440k
      Work area                     16k
      
These sizes are limited to comply with default shared memory sizes. Data can be placed anywhere in the data space. A total of 440 spectra can be in memory at one time. (see read).

Data/Spectra are referred to (see display) by their histogram_id (try ls "listing").
There are two id's; the first id uses the placement in data space starting with id 1 for the first spectrum or the histogram_id which is inherited from the data file. Either id can be used to reference the spectra (see Options menu).

The work area has the default id 0.

Generally, whole spectra are addressed and manipulated, but, all data can be viewed and manipulated in absolute data space by using the proper array addresses. For convenience kilo numbers (chunks of 1024 data words) can be used. When appropriate, a number appended with a k or K will be multiplied by 1024 (eg. 1k -> 1024).
Important restriction!
When accessing the data array as a whole, keep in mind that the zero point is the start point (array offset) of the last called spectrum. A call to the first spectrum selects as zero point the begin of the data array.

Commands

Under the FILE menu is the Sa Command Window (command widget). All command widget properties apply, like command history list. Especially, any command can be repeated by double clicking the command. Line commands consist of a code word and input in form of text and/or numbers.
The number of input entries is important as it determines in many cases the action taken (for a typical example see addc).

A command terminated without input is executed with default or former input parameters.
Not all parameters have to be provided every time.

Most commands act on whole spectra.
A general advice: Spectra should be changed, when possible, only in the work area.
One or more spectra are copied into the work area using the sel id command.
First select a spectrum (sel id) then call the action.

Typical Tasks

Add data (adding spectra)

Adding spectra puts the sum into the work area. The add command adds the data to the content in the work.
A typical command sequence would be

   sel  id      put spectrum with id in work area
   add  idx     add spectrum with id idx to the first and display
                the result in the  work area.
      
The add command can take a list of spectra id's

Examples

	sel 1
	add 2 3 4 will add the three spectra to the content (spectrum 1) in
                  he work space.
        add 2 - 8 will add 2 3 4 5 6 7 and 8
      
If the work area is empty, the sel command can be skipped.
back

Add constant to data

A constant will be added to the selected data.
    addc constant       to spectrum in work area.

    addc constant id    addc constant to spectrum with id

    addc constant	to be added to each channel
	[first ch]	start of spectrum
	[last ch]	last channel
      
Example
    addc 23 0 1k	expands to
			add 23 to the first 1024 data words.
      
back

Command_file Mode

Command files can be executed within XSA.

A command file is a list of input lines as typed in the command widget.
For instance: Edit a cmdfile (a collection of valid commands) like

   r file1 0         ;read and store file1 at beginning of data array
   r file2 4k        ;read and store file2 at address 4096
   add 0 4k 4k       ;add file2 to file1
   w file3 0 4k      ;write sum spectrum (now in 0) to file3
      
and save the list as a file.

Execute the file by calling

   run  filename
      
Any filename starting with the letters "mk" (make) will be run as command file without the "run". If the mk-file has a pathname prepended, like ../mkread, the command run ../mkread has to be typed. A limited argument substitution $1 to $5 can be used.

Examples

Assume the command file "mkread" is:

     open $1par.his
     rs $2
It can be executed as
     mkread sma 0  or
     mkread smb 3
if a file smapar.his exists and contains a spectrum 0 or the filename is smbpar and contains a spectrum 3 it will be read. back

Energy Calibration

The calibration is a linear fit between two energy values. The energy values have to be typed in, the corresponding channels can be taken from the display ('z' or right mouse btn for channel or 3 point centroid). It is important to do all markings without leaving the display mode. The energies and positions have to be in increasing order. Each spectrum may have its own calibration. First select the spectrum (ds) then calibrate.

The number of input tokens determines what is expected:

  cal [CR]      resets calibration to channel numbers,
                which is the default "calibration".
  cal all       resets calibration for all spectra.

  cal filename	calibration stored in a file is read in.

  cal 1.Energy 2.Energy
		Type the energies and get the
		channel information from display.

  cal spectrum_id slope zero_offset
		known calibration is expected
		If id is all, all spectra in memory
		get the same calibration.

  cal 1.Energy 2.Energy 1.Channel 2.Channel
		provides all information for a calibration
		of the current id.

  mcal 2 - 10 slope zero_offset
                multiple id's for the same calibration.

  wcal filename	The calibration can be stored in a file.
		New calibrations are appended to an
		existing file.

  rcal filename A wcal file can be read back.

  cpcal id      After displaying or selecting a spectrum
		the calibration of id is copied to the current spectrum

  esc		(e-scale)
                toggles between "ENERGY" and "CHANNEL NUMBER"
		scale (see Options menu).
      
back

Display Spectra

Viewing data is started using one of the following display ds commands. Once a picture is drawn the viewing field can be modified with single key strokes and mouse buttons actions.
  ds id [-ymax]	Display spectrum with identification id.
		up to 8 spectra can be displayed
		simultaneously on the screen.
		The default id is the position in the
		absolute data space 1,2,3,....
		When appropriate spectra can be selected by
		their intrinsic id (provided by the data file).
		setid toggles between both modes.
		If the last entry is < 0 it is taken as maximum
		of the y-scale

  ds  1 2 3 4	for instance, will display the first 4 spectra.
  ds  1 - 4     has the same effect (spaces are important).
        	The order can be chosen arbitrarily,
		eg. 1 3 8 5.
		Again, if the last number is negative,
		it will be used as YMAX for a fixed scale
		for all displayed spectra (eg. ds 1 2 -500).

  do id		plots data over old picture.
  do id col	specify in addition color of overlaid spectrum.
  do 2 red -100 a optional third input will be taken as YMAX
		for the overlaid data.
  do 2 green 0  A 'zero' as last number invokes auto scaling for the overlaid
                spectrum.
  ov id         similar to 'do id'. In addition it has the
                functionality of the 'ds' command.
  ov 2 4 5      overlayes on the current display spectra 2 4 and 5.

Select a display range.

  dsr 100 512	The display field starts
		at channel 100 and has a length of 512
		until reset using
  dsr[CR]	without parameter.

  dsr 512	If only one input parameter is provided
		it defaults to a new display length.

Define new first channel and display length.

  d fch lch	first channel last channel
		If last channel is less than first channel,
		last ch is taken as the display length.
		First and last channel are relative to the
		last displayed spectrum.
  d 0 1k	displays the first K of current spectrum

  d[CR]		repeats former setting (repaints display).
back

Display Commands

After drawing the picture clicking in the graphics window (left mouse button) switches input focus to that window. Mouse button clicks and single characters from the keyboard can be used to manipulate and analyze the data.

Use of mouse buttons:

Display command list in alphabetical order:

a
automatic peak search. Peaks are marked (Max 100).
b
calculate and display background. After b a number between 0 and 5 has to be typed immediately. This number is the order of the polynomial for the background fit (bb uses the last order again, b- no background). The background is fitted to the data in a window marked 0 to 1 on the left side and 4 to 5 on the right side of the peak. Both background windows can be on one side of the peak. (more information in topic peak).
c
clear all marker.
f
fit up to 4 Gaussian to selected data (see peak).
g
grab/ungrab nearest marked peak for integration or fit. If no peak is marked, select around cursor.
j
display selected region - 1024
h
display selected region + 1024
k
kill last marker.
l
toggle between linear and log display.
m
set a marker at cursor position (Same middle mouse button press).
n
next - display higher data region. In peakmode select next peak.
p
previous - reverses n.
q
replace data between marks by next number typed (0-9).
r
reset expand (remembers 10 levels).
s
sum (integrate) peak content between markers 2 and 3 subtract background in peak mode (formerly i).
t
type marker shown in display window (channel number, energy and data).
u
update, redo peak.
x
start expand. After typing x move the cursor and type x again, the range (region) between the two cursor positions will be expanded. Same press left mouse button drag and release. If the channel has a mark the mark is moved
y
set new y-scale to vertical cross-hair cursor.
z
set channel number or energy (if provided) at vertical cross-hair position if above the data. A 3 point centroid is calculated if the cursor is at the highest of three channels (Same right mouse button press).
,
set successive marks equally spaced (distance between marks 0 and 1)
"
mark the next window with same width as previous window. eg. m2,m3,m4 " m5 will be at m4+(m3-m2).
.
identify channel number and content (Same left button press).
=
display sum of channels between enclosing markers
+
print sums between all markers.
1-9
Immediate shift of that marker to new cursor position.
space
enlarges window in steps.
<      "move" histogram in window to left.
>      "move" histogram in window to right.
back

Gain match Spectra

Histograms can be shifted and gain adjusted.
A gain match factor and/or shift factor have to be provided The default is: gain = 1.0 and shift = 0.0 The factors can be set using gmf.
gmf without input resets the shift and gain match factor.
   gmf 1.007 -8.2  sets the gain match factors to the given values
   gmf -5.3 (one input item only) is taken as shift factor.
   gmf 600.0 1600.0 605.0 1640.0
                will calculate gain match factors to
                match channel 605 to 600 and 1640 to 1600.
   gm id     does the matching. The result is in the work space.
Examples
    gmf 0.5 0.0	the new spectrum will be half the length
    gm id       and be in the work area.
Typically, the last displayed spectrum will be adjusted. If an id is provided, that spectrum will be used.
Similar functionality is provided with the shift and rebin commands.
    shift 1.23   shifts the current spectrum by 1.23 channels to the right
                 WARNING: the result is in the current spectrum not in the work area.
                 Shifts can be negative (to the left).
    rebin 1024   the current spectrum will be re-binned to 1024 channels.
                 the results is always in the work area.
    rebin 1024 3 spectrum with id 3 will be re-binned to 1024 and left in
                 work area.

For gain matching a set of detectors, like Clover detector segments, the gain match information (gain match factors) can be derived within XSA and written out into a file (date_time.gmf).
First, the peak information for the new position (two energies) is provided with the cmd

    pp e1 e2
this initiates a mode where the next two peak positions in the current spectrum should be selected (peak centroids - click right mouse button). Display next spectrum and select next two peaks and so on.

After for all detectors the reference positions were determined

    pp out  (0 is equivalent to out)
is used to write the currently stored information out and the pp mode is terminated. Any selection can be repeated by using
    pp nr
where nr is 1 - 16 (16 detectors max). If nr is omitted the current display id is used. Like
    pp
    ds 1
or clicking in the spectra listing. back

Multiplication/Division of Spectra

Calculate square or ratio of spectra.
    mul id	Spectrum in  work area is multiplied by spectrum with id
    div id	Spectrum in  work area is divided by spectrum with id
		The result is in work area.
In absolute data space:
    div  addr1	start address of data in array
         addr2	start address of other data
         length	total number of channels
Type the start address of the first and second spectrum and the total number of channels to be dived.

Examples

    div 0 3k 1k	will be expanded as, divide 1024 (1K)
		data starting at 3072 by data starting
		at 0 and leave the result in K0.
back

Multiply data by Constant

Multiply data with a floating point number. To divide use fractional factors.
   mulf factor	multiplies whole spectrum in  work area

   mulf factor id
		multiplies data in spectrum id.
In absolute data space:
   mulf 1.25 0 1k
		expands into multiply all channels of the
		first K by 1.25.
back

Mark Position - Move Marker

A position in a spectrum can be 'marked' from the command window.
    m number	where number is the channel number or
		energy if a calibration is provided
One or a group of markers can be moved to a new position. Type
    mm # [#] [#]
then click with the left mouse Button at the new position.

List Spectra

                Pull down File menu and choose listing or
    ls		all spectra  in core are listed:
		index,id,name,begin in array,length,calibration data
Spectra can be called by ind or id. If identical id's in separate spectra, the ind has to be used.
    setid	toggles between id and index. id is default (see Options
menu).
back

Print Data

Data of the selected spectrum are written to the terminal if no filename is provided. A filename is given like for redirected output in the shell.
    pd first_channel last_channel
    pd first_channel last_channel > filename
Example
    pd 100 150	the data of the channels between
		100 and 150 will be printed out.
A xmgrace data file can be written with
    pdg (same as above)
back

Postscript Pictures

   ps

produces a postscript file 'sagraph.ps' containing the current picture. ps works similar to the ds command. ps[CR] takes effectively the screen picture. Text enclosed in " " is taken as title of the picture.

Examples
   ps 1 2 "Detector 3"
Spectra 1 and 2 with a heading 'Detector 3' are written into sagraph.ps
    ps 1 "Title" > newname.ps (changes output file name)

If only one spectrum is selected;
Landscape format is used,
all marks set in that window or region will be converted into channel numbers or energies (if calibration present). If the highest channel is marked a centroid using the adjacent channels will be calculated.

The command lps sends the ps file directly to the default printer. Equivalent: Print of file menu which 'copies' the screen.

Graphs can be overlaid (in colors) using pso instead of ps like in

   pso 2 5 -ymax

If the last entry is a negative number, it is used as YMAX for all spectra. -1 in overlay mode invokes auto scaling for each spectrum.

   pso

An overlay picture can also be printed using the current screen layout (preserving the yscales).

The title can use super or sub scripts. Subscripts start with "_" and and end with "^" and vice versa. So, ^152_Eu becomes 152Eu.

One spectrum is always plotted using LANDSCAPE format. ps1 plots spectra in 1 column (PORTRAIT). 1-8 spectra fit on one page.

    ps1 2 - 5 > name.ps
        spectra 2 3 4 5 are written in postscript file 'name.ps'.

ps2 does the same in 2 columns. Up to 16 spectra fit on one page.
back

Peak Integration or Peak(s) Fitting

To analyze peaks select first the peaks of interest by marking them (e.g. automatic peak search).

In command mode peaks are called by their marker number.

    p peak_no	peak number
      width	optional width of display window
		Default is 64 left and right of peak.
    pm peak_no  imports all peak marks from the specified peak

Examples
    p 0 [110]	select peak zero. The optional [#]
		replaces the width parameter.
    p [CR]	repeat last peak
    pm 0        make peak marks from peak zero the current markers.
A marked peak can also be selected by moving the cursor close to the peak and typing g for grab.

The peak and a window around the peak will be displayed. Set marker for background region left (0 to 1) peak region (2 to 3) and background region right (4 to 5).

Fit background polynomial b. If no bkgd is needed, simply do not select the order of the bkgd polynomial or reset it with b-. In this case only two marks (0 and 1) need to be set.

A simple summation is started with s or i (integrate).

For a Gaussian fit the center of the peak or peaks (max 4) has(ve) to be marked (marker 6 to 10) before f (fit) is started. Even if bkgd should be set zero all marks have to be set.

The results are written to the screen and to the file sa.dat (check file results.dat), which contains shortened information of your session. All markers and the order of the background polynomial are stored for further use. All display mode commands are enabled. After a fit or peak area summation of the selected peak typing g returns the picture to the full screen.

Sometimes, it is desirable to sum many peaks automatically. Using the so called 'flat upper limit' method a background can be determined for the whole spectrum and then subtracted.

    ful id
A 'background free' spectrum is generated in the work area and the background spectrum is left in the adjacent work area for viewing and error calculation of peak sums (addr: w+len).

Examples

    ds 1         thats your spectrum
    ful 1        does the background calculation
    ds w         show the data without bkgd (see sum)
    ds 1         shows data
    do w+2k red  overlays the bkgd curve (if a spectrum has length of 2k)

Setting marker pairs for peak regions and issuing the command sum produces a list of peak sums (center of gravity, peaks sum, peaks sum error).

Examples

    sum 2        sum between all marker pairs in spectrum 2,
                 errors are sqrt of content.
    sum 3 1      sum in spectrum 3, take bkgd  and errors from spectrum 1
    sum 3 w s    sum in spectrum 3 (no bkgd subtracted), 
                 take errors from spectrum in work area using 
                 sqrt of these sums as error only.
                 beside s, n (no bkgd), b (bkgd), similar ps, pn and pb.
                 p signals that marker pairs are set in peak mode.
back

Read Data

Data can be read in various ways:
r
read whole file at once
rs
read one "spectrum" at a time
rc
read column(s) of matrix file
rr
read row(s) of matrix file

Internally, all data are stored and used as real independent of their file format.

    r File_name file name of spectrum
      K no      K no of start address in memory.
		Read_in should start only on full k boundaries.

    r myfile 2k	myfile is read and stored from address
		2048 up-wards the length is taken from file header.
		If the K no is omitted, the new data are stored
		at the beginning of the data array.

    r myfile a  the next data are appended to the data array.

    rs File_name
		file name of spectrum
       Spec no	spectrum to be read from file
       Address	start address for data in memory array

    rs myfile 1 0
		myfile spectrum with id 1 is read and stored
		beginning at addr 0.
In subsequent reads from the same file only the spectrum number and optional the K number are required (rs 2 0).

2-dim. Files

    rr File_name matrix name
    row		 starting row
    rows	 number of rows
    address	 start address for data

This creates a cut of the matrix and stores the result as spectrum.

Similar input is used for reading columns. The short input form requires no File_name. If another file name is needed the long form has to be used or a file can be opened using the command

      file  name	open file for subsequent reading
      open  name        is synonymous.
The cd command can be used to set a path to a different directory. cd without input resets to the default directory. Likewise pwd tells where data are read from. A File menu entry Open... brings up a file selection box from which a read (reads the whole file into the next free data space) or open (opens only the file) can be selected.
back

File Header

The first 1024 bytes of a "SA data" file constitute a Header Block with the following structure:
  struct filehead {         /* File Header Block */
      char name[16];        /* Character line: "his/.." */
      int  nrun;            /* Run number */
      int  dtype;           /* Data Type: 0 long; 1 short unsigned; 2 real*/
      int  len;             /* Total Number of Channels */
      int  maxid;           /* Max Number of Spectra */
      struct {	      
          int id;           /* spectrum id */
          int offs;         /* begin of spectrum in file */
      } sinfo[124];         /* id and offset of each spectrum */
  };
A data file always starts with the word 'his/' or 'data/*'[phased out], the next characters can be anything followed by '\0'.
If flhd.dtype >= 3 a matrix format is assumed.
	flhd.maxid         = 1;
	flhd.sinfo[0].id   = row_length;
	flhd.sinfo[0].offs = column_length;
flhd.len is the total number of data words (excluding the header). A file can contain up to 124 spectra (sinfo) each can have an unique identification number (flhd.sinfo[i].id) and has to have a start point. By definition flhd.sinfo[0].offs = 0;

Read Marks back

All marks (general and peak mode) are read from a file with the extension .mks. Such a file is created with the commands wmarks or wm.
The filename extension .mks is appended automatically.
    rmarks filename of marker file.
    rm     (for short)

Read Variable

Some variables, like thet1, thet2 and thet3, angles used for the anisotropy and slope calculation, can be changed in the GUI, but also "dynamically" read in within a cmdfile. The cmd format is
    rv name value
Examples
    rv thet3 70.0
    rv thet1 50.0
    rv q2 0.97
currently only thet1, thet2, thet3, q2, q4 (attenuation factors) can be read.

Reset Marker Array

    reset[CR]	all markers including the background
		markers are cleared.
back

Set output File Head

Data written into a file from the work area can be structured as several spectra (standard data format).
    sflhd num	   select number of spectra
The number of channels per spectrum is calculated from the total length and num. All spectra then have the same length.
back

Subtraction of Spectra

This command works like the add command.
Only some content should be in the work area to start.

Transfer of Data in Memory

Is used only independent of spectra substructure. A transfer is basically from to length "title" id
    tr start_addr first address
       new addr   second address to which data are moved
       length     number of channels to be transferred.
       "title"    optional name, used in ls.
       id         optional new id
Examples
    tr 2k 0 2k	transfer two K of data from second
		to first K
    tr [CR]	uses former numbers again
    tr w 10k 2k transfer data from work area to 10k (2k long)
    tr w+2k 8k 2k "bkgd" 5
    tr w        work area data are transferred to 'end' of used data space
                simplifying space selection
back

Write Data File

    w File_name	Name of output file
      startaddr	Start address of data set
      length	number of channels
The output file is written in the standard data format. The spectra organization present in memory is kept in the file header. Examples
    w file 2k 4k 3  stands for write file of 4096 
		    channels beginning at address 2048.
		    and set run_number to 3

    wf name	    writes data as floating numbers.
                    If only a file name is provided the data of the work area
                    are written out.

    wspe name       writes data of the work area as .spe (Radware) file

    wasci name      writes data (work area) as ASCII list to file

The File menu entry Save brings up a message dialog for writing data to disk.
back

Write Marks

Saves marker array in file with extension .mks (marks).
See read back
    wmarks filename	stores the marker array.
    wm
This effectively makes a suspension of XSA possible. To resume start XSA read data and marker file and continue.

Write Windows

A file containing marker pairs for sorting cuts is written to disk with an extension .win. A .win file is written in ASCII format.
    ww name
There is also a rw command to read windows back.
back

Zero Data Region

    zero id           zero spectrum
    zero first ch     first channel
         last ch      last channel
The channel numbers refer to the total histogram array. If last channel is less than first, last ch is taken as length. Examples
    zero 2         zero spectrum with id = 2
    zero 1 3 6 - 9 zero spectra 1 3 6 7 8 and 9
    zero 0 1k	   clear first K of current spectrum
    zero all	   zero all data
    zero reset     clear all spectra and reset number of histograms to 0
    clear          synonym for zero reset
back

Set Data

Sometimes it is useful to set a data point or region.
    set channel new-Data
    set new-Data
               and click in window (between 2 marker).
back

Transient field Analysis

XSA has built in special functionalities for the analysis of spectra containing small differences in counting rates in selected peaks. Such spectra are taken typically in perturbed angular correlation measurements.

A special set of commands is provided: ud,rat,anis.

Begin up-down mode

Assume a four detector setup symmetric to the beam direction;
two detectors at a backward angle and two detectors at a forward angle.From a small difference in the peak area of a γ line the rotation of an angular distribution for two settings of a magnetic field at the target (UP and DOWN) has to be determined.
The data contain at least two sequential spectra per detector, one UP spectrum and one DOWN spectrum. For coincidence data usually two more spectra are required containing random counts, for a total of 4 spectra per detector (up_prompt, down_prompt, up_random and down_random).
Usually the same peaks is analyzed in 4 spectra (one spectrum per detector). To keep separate peak integration marks for each detector (each spectrum), it is recommended to mark the peak for each detector. Proceed with the usual peak integration. Both, the UP and DOWN spectra are analyzed with the same set of makers. The corresponding peak sums (up and down for detectors 1 to 4) are then used for the double ratio calculation rat. If more than one peak in a spectrum should be analyzed, the second peak should be marked 4 ,5, 6, and 7 (for detectors 1 - 4 respectively) and so on. Up to 25 transitions in a measurement can be analyzed at one time, but is is simpler to work on one peak at a time.
    ud ndet id np
For each detector ndet the 4 spectra starting at a given id are selected for analysis. The default id is 1.
The id and peak group np is only read with ndet = 1. np is 0 for the peak group 0 1 2 3 and 2 for the peak group 4 5 6 7 and so on An averaged spectrum (UP + DOWN)/2 is displayed.
All peaks for analysis should to be marked in the usual way. Peaks can be summed or fitted. The results for UP and DOWN are separately displayed.

Double Ratio

After peaks for all 4 detectors are analyzed, special double ratios of the counting rates for each peak are calculated.
    rat np number
np is 0 for peaks 0-3 (1 for peaks 4-7 and so on) and number is the number for how many of such peak groups ratios should be calculated. Examples
    rat 0 1    only the ratio for the first peak group is calculated.
The peak areas are logged in a file, default name "rlog.dat", for further analysis. This default name can be overwritten.
    rat 0 1 > newfile
The new file name is in effect until changed or the program is restarted.

In principle 2 detectors are sufficient for a double ratio.

     rat2 det1 det2
calculates a double ratio for two detectors, which have to be provided where det1 det2 are the numbers of the detectors.

back

Anisotropy ratios

The coefficients A2 and A4 of a particle - γ angular distribution are derived from two measurements, where at minimum two γ detectors are used, both placed at two different but opposite angles. From double ratios of the peak rates a ratio of the intensity at the two angle positions independent of detector efficiency and time for each measurement is derived. The peak intensities are assumed to be stored in a specific order (det1-high, det1-low, det2-high, det2-low). In the Options menu is a widget to select all needed parameters. Returned are A2, A4 and the logarithmic slope used to calculate precession angles from effect ratios (rat).
    anis
For this to work, the order of the peak information should be as follows:
Det1(45°),Det1(90°),Det4(45°),Det4(90°),
Det2(45°),Det2(90°),Det3(45°),Det3(90°).
If the spectra are ordered in this sequence, the sran 1, sran 3, .... sran 15 command sequence puts the data in the proper order.

anis can also be used with a known anisotropy ratio.
The command is

     anis R dR
where R is the ratio and dr its error. All back

Peak sums with subtraction of randoms

Coincidence data usually come as two spectra: TRUE+RANDOMs and RANDOMs.
Most often the RANDOMs spectrum follows directly the TRUE+RANDOMs spectrum. The command sran helps in the peak analysis.
    sran id
The spectrum with id is put into the work area with the random spectrum subtract. Mark and select a peak of interest. Sum or fit peak. The random subtraction is included in the peakarea error when written out.
    sran id1 id2
id2 is the id of the randoms spectrum if other than id1+1.
    sran id1 p #
a p (for peak) with a peak number can be added in the command line to select a peak for immediate summation.
Since this command invokes the random summation in the process, it puts XSA in a special mode, which is canceled only when the s or i command is used to write out the result.

Miscellaneous Commands

    esc         toggles between Energy scale and Channel numbers
    cd [path]   change data directory
                without path reset to starting directory
    ls          list what is in memory
    ful id      ful creates a background free 
                spectrum of id in work area plus the 
                background next (adjacent) in the work area
    pwd         show the current data directory
    rebin nk    rebins current spectrum to new (nk) length (e.g.2048 -> 1024)
    setid	toggles between id and index.
    scale # #   creates a channel by channel scale factor spectrum
                from summed windows.
    shift ch    shift current id spectrum by ch channels.
    sqrt        makes a sqrt spectrum from current id.
    sum         sum Peak Integration or Peak(s) Fitting
                between marker pairs, write to results.dat
                useful after using ful background subtraction.
    system      invoke system call (like 'date', 'echo' ...)

EXIT Program

    exit[CR]	normal exit of program.
    quit[CR]	The log files are removed on exit. 
back

Command List Summary

Display

      "ds"     :  display 1 or more spectra                    ( disp     )
      "do"     :  overlay spectrum			       ( disp_o   )
      "ov"     :  overlay list of spectra                      ( overlay  )
      "d"      :  redisplay or display selected region	       ( disp_d   )
      "dsr"    :  set display range			       ( set_dsr  )
      "log"    :  display in log scale (subtract decade)       ( logdis   )
      "lin"    :  display linear			       ( lindis   )
      "setid"  :  toggle use of file / data space id 	       ( set_id   )

Data input/output

      "r"      :  read whole file			       ( readfile )
      "rs"     :  read selected spectrum from file	       ( readspec )
      "rc"     :  read matrix data, select columns	       ( readcol  )
      "rr"     :  read matrix data, select rows	               ( readrow  )
      "file"   :  open datafile for reading		       ( get_fln  )
      "open"   :  open datafile for reading		       ( get_fln  )
      "cd"     :  set path for reading data files	       ( chpath   )
      "pwd"    :  show directory from where data are read      ( prpath   )
      "w"      :  write new file (integers)		       ( wrtf0    )
      "wf"     :  write new file (floating numbers)	       ( wrtf2    )
      "wspe"   :  write Radware file .spe                      ( wspe     )
      "wasci"  :  write ASCII data to file                     ( wasci    )
      "tr"     :  transfer data in memory		       ( trans    )
      "sel"    :  select (copy) spectra in work area	       ( sel_id   )
      "ls"     :  list spectra in memory		       ( shspec   )
      "zero"   :  purge spectra from memory		       ( zero_dat )
      "clear"  :  clear all data space		               ( clear    )
      "ps"     :  create postscript picture file	       ( psfile   )
      "pso"    :  create postscript data in overlay mode       ( o_psfile )
      "lps"    :  send postscript picture to printer	       ( p_psfile )
      "lpso"   :  same for overlay mode		               ( po_psfil )
      "pd"     :  print data as vector list (sa.dat)	       ( pridata  )

General

      "cal"    :  calibrate energy scale		       ( calibrat )
      "cpcal"  :  copy calibration to display region	       ( cpcal    )
      "wcal"   :  write calibration data to file	       ( wcal     )
      "esc"    :  toggle energy scale display		       ( escale   )
      "m"      :  mark; type channel number to be marked       ( set_mark )
      "mm"     :  move[mark] one/several marks to new position ( mv_marks )
      "reset"  :  clear all marker			       ( reset    )
      "rmarks" :  read marker file back		               ( rmarks   )
      "wmarks" :  write marker file to disk  (.mks)	       ( wmarks   )
      "ww"     :  write window (marker pairs) to disk (.win)   ( w_win    )
      "rw"     :  read window file back		               ( r_win    )
      "p"      :  select marked peak for integration	       ( peak     )
      "pm"     :  import peak marks from an other peak         ( peakmar  )
      "i"      :  sum peak (integrate)			       ( integrat )
      "f"      :  fit Gaussian to peak[s]		       ( fit      )
      "aps"    :  set automatic peak search factors	       ( set_aps  )
      "nspec"  :  set number of spectra (work area)	       ( set_flhd )
      "set"    :  set individual data point in spectrum        ( data_set )
      "sum"    :  sum content for list of window	       ( sumlines )

Spectra

					                   
      "add"    :  add spectrum to data in work area	       ( add      )
      "addc"   :  add a constant to all channels	       ( forge    )
      "sub"    :  subtract spectrum from data in work area     ( sub      )
      "sran"   :  subtract two spectra and put in work area    ( subran   )
      "mulf"   :  multiply data in work area by a factor       ( forge    )
      "div"    :  divide two spectra			       ( divide   )
      "mul"    :  multiply two spectra			       ( multiply )
      "smooth" :  smooth data				       ( smooth   )
      "sqrt"   :  make square root of data in work area        ( forge    )
      "gmf"    :  set shift and gain change factors	       ( set_scf  )
      "gm"     :  apply shift and gain change		       ( g_match  )
      "scale"  :  select scale factors (special feature)       ( scale    )
      "cut"    :  cut negative data of spectrum	               ( forge    )
      "ful"    :  "flat upper limit" background subtraction    ( genful   )

Transient

      "ud"     :  select data set for up/down analysis	       ( udselect )
      "anis"   :  calculate anisotropy ratio                   ( anis     )
      "rat"    :  for u/d analysis make 4 det. double ratio    ( dratio4  )
      "rat2"   :  for u/d analysis make 2 det. double ratio    ( dratio2  )

Misc

      "run"    :  run command list file		               ( runfile  )
      "system" :  execute shell command		               ( dosystem )
      "exit"   :  exit XSA 				       ( exitus   )
      "quit"   :  exit and delete log files		       ( quit_pro )

back Up to Outline.

Back to Rutgers Physics Home Page


Gerfried Kumbartzki
Last modified: Thu Mar 12 15:16:05 EDT 2009