wspec2xl.pl

 

 

Procedure

 

The script scans a spec file to integrate requested (fast)scan. It allows counter dead time corrections and it take account of filters to correct intensity and get the right standard deviation. Each integration is performed using 4 ways to define the background, then a weighted value of the line intensity is given.

Short examples

no option : full scan

....> spec2int.pl int.fourc 
## spec2int.pl    int.fourc   Tue Jan 29 08:27:05 2002
## $Id: spec2int.html,v 1.3 2006/04/12 14:01:12 berar Exp $
## option set to : valid monitor (poisson_level=3), q=no_hkl
## border_size=4, excluded_down=1, excluded_up=1
## opt_D='DET,vct1_4', opt_M='MON,vct1_3', opt_R='pseudoC', opt_F='pfilter'
## opt_T='Seconds', no dead time corrections
## filters=1
#S    Intensity   s(I)    Normalised s(N)   Monitor @ Center
 133 3.61591e+09 2.869e+05      35895    2.848   100736   625.04
 139 1.04919e+07 2.856e+04    104.806   0.2853   100109   476.22
#scan #S140  hklmesh  L -0.3 0.3 30  K 3.593 4.193 30  -100000
#error : monitor can not be fitted 13887.3 :   341229 -31.6024 0.142906
 141   181779    723.5    4.14415   0.0165  43864.1    49.38
 142   182989    695.3    4.17183  0.01585  43863.1    49.35
 143  8563.01    606.5   0.193553  0.01371  44241.1    46.32
 144  4455.88      329   0.102563 0.007572  43445.4    49.53
 145  4740.55    356.8   0.107717 0.008107  44009.4    49.04
 146   110860     1608     2.5194  0.03653  44002.5    48.83
 147  69051.8    916.7    1.57002  0.02084  43981.5    48.48
 148   242971     1255    5.55115  0.02867  43769.4    50.00
 149  50260.6    373.3    1.14083 0.008473  44056.1    47.64

get only few scans with no extra lines

.......> spec2int.pl -n -m"14[267]" int.fourc
 142   182989    695.3    4.17183  0.01585  43863.1    49.35
 146   110860     1608     2.5194  0.03653  44002.5    48.83
 147  69051.8    916.7    1.57002  0.02084  43981.5    48.48

eval choosen scans and get somes details

note we use "'" in order to avoid shell interpretation of eval expression
........> spec2int.pl -v -s'$scan>145&&($scan%2)==0' int.fourc
## spec2int.pl    int.fourc   Tue Jan 29 08:33:36 2002
## $Id: spec2int.html,v 1.3 2006/04/12 14:01:12 berar Exp $
## scan evaluating ...$scan>145&&($scan%2)==0...
## option set to : valid monitor (poisson_level=3), q=no_hkl
## border_size=4, excluded_down=1, excluded_up=1
## opt_D='DET,vct1_4', opt_M='MON,vct1_3', opt_R='pseudoC', opt_F='pfilter'
## opt_T='Seconds', no dead time corrections
## filters=1
#S    Intensity   s(I)    Normalised s(N)   Monitor @ Center
#S 146  afscan th 7.1152 7.6152 100 0.5
# peak2 9  36633.3(3076.75) 0.084  bkg 3294.1 89 (-511.314 157.265 -1.62008) 19.8 3410.1 49.0
# peak1 13  69809.5(493.488) 0.007  bkg 1670.2 85 (1672.73 -0.051663      0) 32.4 4085.4 48.9
# bkg_1 86   163535(518.555) 0.003  bkg 713.8 12 (717.816 -0.0821174      0) 1.0 40.5 48.7
# bkg_2 86   152809(7324.49) 0.048  bkg 838.6 12 (698.449 7.96906 -0.0830019) 0.8 29.0 48.7
 146   110860     1608     2.5194  0.03653  44002.5    48.83
#S 148  afscan th 7.2629 8.2629 100 0.5
# peak2 41   233102(1867.73) 0.008  bkg 794.5 58 (468.875 13.9176 -0.140219) 1.5 118.0 50.1
# peak1 44   240833(550.75) 0.002  bkg 621.5 55 (610.832 0.219089      0) 3.4 187.6 50.0
# bkg_1 78   248235(563.756) 0.002  bkg 546.5 21 (537.491 0.189949      0) 1.0 37.0 50.0
# bkg_2 77   242296(3914.93) 0.016  bkg 622.8 22 (518.556 5.15698 -0.0511114) 0.9 32.1 50.0
 148   242971     1255    5.55115  0.02867  43769.4    50.00

more complete output including Q components

........> spec2int.pl -q -V2 -d1e-6 -ffilter -s'$scan==148' int.fourc
## spec2int.pl    int.fourc   Tue Jan 29 08:37:45 2002
## $Id: spec2int.html,v 1.3 2006/04/12 14:01:12 berar Exp $
## scan evaluating ...$scan==148...
## option set to : valid monitor (poisson_level=3), q=hkl, opt_Q=' %5.2f'
## border_size=4, excluded_down=1, excluded_up=1
## opt_D='DET,vct1_4', opt_M='MON,vct1_3', opt_R='pseudoC', opt_F='pfilter'
## opt_T='Seconds', opt_d='1e-6'
## opt_f=filter
## filters=1 3.382 11.57 39.13 147.5 498.8 1707 5772 1.966e+04 6.648e+04 2.274e+05 7.692e+05 2.9e+06 9.806e+06 3.355e+07 1.135e+08     .5999        16
#S     H   K   L    Intensity   s(I)    Normalised s(N)   Monitor @ Center
#L THETA  H  K  L  pfilter   Seconds  MON   DET
#base_fit 99  43905.9 -5.17826 0.0489879 1.0
# peak2 41   241442(1872.46) 0.008  bkg 795.8 58 (469.267 13.9542 -0.140589) 1.6 118.3 50.1
# peak1 44   249194(558.402) 0.002  bkg 622.2 55 (611.596 0.219611      0) 3.4 188.1 50.0
# bkg_1 78   256615(571.232) 0.002  bkg 547.1 21 (538.073 0.190344      0) 1.1 37.1 50.0
# bkg_2 77   250662(3920.12) 0.016  bkg 623.6 22 (519.094 5.16867 -0.0512276) 0.9 32.2 50.0
 148 -0.00  3.61 -0.00   251324     1264      5.742  0.02889  43769.4    50.01
d2pluo2 BM2IMG/scripts> spec2int.pl -q -V2 -d1e-6 -ffilter -s'$scan==148' int.fourc
## spec2int.pl    int.fourc   Tue Jan 29 08:37:45 2002
## $Id: spec2int.html,v 1.3 2006/04/12 14:01:12 berar Exp $
## scan evaluating ...$scan==148...
## option set to : valid monitor (poisson_level=3), q=hkl, opt_Q=' %5.2f'
## border_size=4, excluded_down=1, excluded_up=1
## opt_D='DET,vct1_4', opt_M='MON,vct1_3', opt_R='pseudoC', opt_F='pfilter'
## opt_T='Seconds', opt_d='1e-6'
## opt_f=filter
## filters=1 3.382 11.57 39.13 147.5 498.8 1707 5772 1.966e+04 6.648e+04 2.274e+05 7.692e+05 2.9e+06 9.806e+06 3.355e+07 1.135e+08     .5999        16
#S     H   K   L    Intensity   s(I)    Normalised s(N)   Monitor @ Center
#L THETA  H  K  L  pfilter   Seconds  MON   DET
#base_fit 99  43905.9 -5.17826 0.0489879 1.0
# peak2 41   241442(1872.46) 0.008  bkg 795.8 58 (469.267 13.9542 -0.140589) 1.6 118.3 50.1
# peak1 44   249194(558.402) 0.002  bkg 622.2 55 (611.596 0.219611      0) 3.4 188.1 50.0
# bkg_1 78   256615(571.232) 0.002  bkg 547.1 21 (538.073 0.190344      0) 1.1 37.1 50.0
# bkg_2 77   250662(3920.12) 0.016  bkg 623.6 22 (519.094 5.16867 -0.0512276) 0.9 32.2 50.0
 148 -0.00  3.61 -0.00   251324     1264      5.742  0.02889  43769.4    50.01

The inline help

The command wspec2int.pl -h will display its principal key words.
.....> spec2int.pl -h
## script/spec2int.pl       Wed Apr 12 15:59:57 2006
## $Id: spec2int.html,v 1.3 2006/04/12 14:01:12 berar Exp $

usage: script/spec2int.pl [-h]
  script/spec2int.pl [-m"m"|-s'exp'] [-qtnv] [-Qf] [-Vv] [-M"m"] [..other options..] specfile

Integrate (fast)scans in specfile.
     -h Help -- just display this message and quit.
     -m xxx : result concern only scans name matching *xxx*
     -s xxx : result concern only scans for which exp is true  '(($scan%3)==2)'
     -q : HKL  -Qf format (default -Q" %5.2f")
     -n : no comments  -v verbose
     -D"DET,vct1_4" : default list for detector name, if not found tries last column
     -M"MON,vct1_3" : default list for monitor name
     -t : test match
     -v : verbose(V=1), -Vv set verbose level to v
     -R"pseudoC" : define the REAL detector for deadtime correction if different"
     -dT : if supplied correct for deadtime=T according d-value"
     -T"Seconds" : define the time column name for deadtime correction
     -F"pfilter" : define the filter column name for filter correction
     -f"v0,v1,v2..." : use v0, v1 as filter values
     -f"filename" : v0, v1 are read from filename which contains lines with i vi values
        if no -f option is specified use fourc corrected values if possible
     -pP : poisson confidence level on monitor fit (default 3)
          -bB : border size (default 4)
          -iI : inside peak (default 4)
          -xd,u : excluded points : down, up (default 1,1)
          -W"outputFile" : corrected counts to
  example script/spec2int.pl -s '($scan>20&&($scan%2)==1)' fourc.xxx
  example script/spec2int.pl fourc.20Jun04                 => process the whole file
  example script/spec2int.pl -W'correctedFile' fourc.xxx
  example script/spec2int.pl -f'filter' -W'newSpec'  -D'vct1_5' -m 407 fourc.20Jun04
  example script/spec2int.pl -f'filter' -W'newSpec'  -D'vct1_5' fourc.20Jun04    => process the whole file and write new corrected file

 

 

source

The perl script can be run by every users, it is located in /usr/local/bin. As perl is a widely used scripting languages it may also be run on other systems including MS_Window if the perl executable can be run.


$Id: spec2int.html,v 1.3 2006/04/12 14:01:12 berar Exp $