Setting gates using gg


This software can be found in "/dk/gsp1/disk1/bgo/tl/bin" as smatnl on any machine that has disk "/dk/gsp1/disk1" mounted over the network.

Note: calling the programs mentioned in this documentation without an agument prompts the programs to write 'help' descriptions of their use. This is where you find the latest updates also!.

Severeal things must be prepared before gates can be set on the (non-linear) matrices generated by the smalnl sorting package.

Following is a "preparation" section and a "final use" section.


preparation for setting a gate on a (non-linear) matrix

First one must find the background factor f to be applied to the first level background subtraction:

          <>.mpg -  f *  <>.mbg
chich is done gate by gate, that is: a gate is set on both the primary gated matrix <>.mpg and the background matrix <>.mbg. The fist level background subtracted gate is this first gate with a fraction of the latter gate subtracted.

The factor f in this background subtraction is found using the following procedure:

Keep in mind that if it is a non-linear matrix that is operated on then the background subtracted total projection is also non-linear. Thus, the energy peaks in the spectrum must be interpretated via the lookup table. It may be necessary to adjust the background subtraction factor in the .fac file until a satisfactory background-subtracted total projection is produced. To generate the spectra used in the 2'nd level background subtraction do the following steps: In summary, you should now have the following files:
  <>.mpg      primary gated matrix
  <>.mbg      background matrix
  <>.fac      first level background subtraction factor
  <>.tpx      tp after 1 level background subtraction
  <>.bgx      __associated smooth background
For the actual gate setting use program gg. It can run in two modes: one where the gates set on the nonlinear matrix are expanded into a linear equivalent spectra and another mode where it just extracts a gate (useful for a case where the matrices are actually linear). An example of the first type:

tl% gg ang86 sd_sec_gates.gat _a86 lookup.dat 1.0 4000

will read primary gated matrix: ang86.mpg
will read background matrix...: ang86.mbg
will read matrix factor file..: ang86.fac
tpx (1 level backgnd sub).....: ang86.tpx
tpx (1 level backgnd sub).....: ang86.bgx
generic file name id string...: _a86
will use lookup table.........: lookup.dat
final spectrum dispersion.....:  1.00 kev
final spectrum length.........: 4000

read 8192 lines from lookup.dat

gatefile: sd_sec_gates.gat
# of gates: 6
gate   1: name> 0257 - from 425 to 429
gate   2: name> 0300 - from 487 to 490
gate   3: name> 0340 - from 545 to 548
gate   4: name> 0380 - from 600 to 603
gate   5: name> 0459 - from 700 to 704
gate   6: name> 0496 - from 746 to 764

peak/background ratio: 0.755290

reading matrix ang86.mpg...
reading matrix ang86.mbg...
projecting...
sum of counts in pg: 8024379.000000
sum of counts in bg: 324315072.000000
-> background factor: 0.018688

spe_name:  , 2047 ch, rec 24/24-8188/8188
spe_name:  , 2047 ch, rec 24/24-8188/8188

  1 * bf: 0.0022952  -> g0257_a86.spe
  2 * bf: 0.0019125  -> g0300_a86.spe
  3 * bf: 0.0019965  -> g0340_a86.spe
  4 * bf: 0.0020691  -> g0380_a86.spe
  5 * bf: 0.0031496  -> g0459_a86.spe
  6 * bf: 0.0118014  -> g0496_a86.spe
sum: -> sum_a86.spe

There are 6 (possible) arguments to the program (3 must be given). The first one specifies the matrices and factor file etc. to use. You just supply the generic name and gg will add the extensions when it reads the matrix and spectra. The next argument is the gate file (nearly in Radford format; click here for full documentation) and the next again is a generic file name used to identify the gates written out. The 1.0 specifies 1.0 kev/ch and here we ask for 4000 channels of expanded channels to be written out. Note: 1)the sum of the gates is also written out and 2)calling the program gg without arguments will give some help.

An example of the use of the gg program without expanding the gates to 'constant dispersion equivalent' spectra is given below (note: the program will automatically check if you have specified a lookup table or not).


tl%gg ang86 sd_sec_gates.gat _a86 

will read primary gated matrix: ang86.mpg
will read background matrix...: ang86.mbg
will read matrix factor file..: ang86.fac
tpx (1 level backgnd sub).....: ang86.tpx
tpx (1 level backgnd sub).....: ang86.bgx
generic file name id string...: _a86
will NOT use non-lin energy lookup table

gatefile: sd_sec_gates.gat
# of gates: 6
gate   1: name> 0257 - from 425 to 429
.
.
... etc