wspec2xl.pl : perl script to summarize a spec session running winview
Procedure
The script scans a spec file to gather information concerning CCD. It can extract the info by frames or by images. A filter on the image name can be used to avoid to look at alignement or dummy images. A "clean" list of images is printed after reading the whole the dataspec file, then if an image has been overloaded the list contains only the last information. Options allows to get also the "raw" list and a frame list. This script can be used with bm2img to normalise image for saxs experiments.
Short examples
no option : full scan
d2mat(berar)~/Spec> wspec2xl.pl ~silveira/dataspec/saxsext.17Nov01 ## wspec2xl.pl (Nov.28th,2001) /mat_dsk1/visit/silveira/dataspec/saxsext.17Nov01 Wed Nov 28 09:11:54 2001 ## option set to : c=2, m=4, q=no_hkl, b=no_beam d=no_date r=clean_list f=no_frames # 239 matching images found, 200 not overwriten ## sample file frames time Pm0 Pm1 xsamp zsamp XstoP ZstoP 0 01nov1 --- 1 1.00 14739 1 138 0.83 3 0 0 01nov10 --- 1 20.00 285981 256530 46 0.28 0 0 0 01nov100 --- 1 200.01 3041470 3725500 92 0.77 0 0 0 01nov101 --- 1 200.01 3035520 2762140 138 1.16 0 0 ............. 0 bidon65 --- 1 1.00 15460 15905 92 0.77 0 0 0 bidon7 --- 1 1.00 14817 16739 92 43.77 0 0 0 bidon8 --- 1 1.00 14930 17003 46 43.39 0 0 0 bidon9 --- 1 1.00 14936 5432 0 43 0 0
simple match : scan only *01nov6* images
d2mat(berar)~/Spec> wspec2xl.pl -m01nov6 ~silveira/dataspec/saxsext.17Nov01 ## wspec2xl.pl (Nov.28th,2001) /mat_dsk1/visit/silveira/dataspec/saxsext.17Nov01 Wed Nov 28 09:13:31 2001 ## image name matching ...01nov6... ## option set to : c=2, m=4, q=no_hkl, b=no_beam d=no_date r=clean_list f=no_frames # 12 matching images found, 11 not overwriten ## sample file frames time Pm0 Pm1 xsamp zsamp XstoP ZstoP 0 01nov6 --- 1 500.03 7216350 1829470 230 1.38 0 0 0 01nov60 --- 1 200.01 3131410 3526410 138 1.16 0 0 0 01nov61 --- 1 10.00 156542 157164 138 44.16 0 0 0 01nov62 --- 1 200.01 3131770 3187640 92 43.77 0 0 0 01nov63 --- 1 20.00 313921 296347 46 43.39 0 0 .............
exact name : get only *01nov6* images
d2mat(berar)~/Spec> wspec2xl.pl -M01nov6 ~silveira/dataspec/saxsext.17Nov01 ## wspec2xl.pl (Nov.28th,2001) /mat_dsk1/visit/silveira/dataspec/saxsext.17Nov01 Wed Nov 28 09:15:33 2001 ## image basename equal to '01nov6' ## option set to : c=2, m=4, q=no_hkl, b=no_beam d=no_date r=clean_list f=no_frames # 2 matching images found, 1 not overwriten ## sample file frames time Pm0 Pm1 xsamp zsamp XstoP ZstoP 0 01nov6 --- 1 500.03 7216350 1829470 230 1.38 0 0
sum mode and simple match : scan only *avr3* images
The value of the current and of "other" are averraged. The counts on PMs and the measuring time are added. The date correspond to the last frame. The frame column is the number of aded frames.
d2mat2(berar)~/progs/Img> wspec2xl.pl -m avr3 -S saxsext.12Apr00 ## wspec2xl.pl (Apr.18th,2000) saxsext.12Apr00 Tue Apr 18 11:52:32 2000 ## image name matching ...avr3... ## sum mode, no frames output ## sample file frame mA time pm0 pm1 pm2 other date 0 00avr3 1 176.50 1.00 0 1 2 23.48 Wed Apr 12 17:18:17 2000 4 00avr30 10 190.16 100.01 72394 824267 47 23.593 Wed Apr 12 21:37:27 2000 9 00avr31 10 190.02 50.00 36097 450726 27 23.435 Wed Apr 12 21:40:43 2000 10 00avr32 10 189.91 10.00 7174 89692 5 23.402 Wed Apr 12 21:43:02 2000 11 00avr33 10 189.81 50.00 36209 442026 28 23.382 Wed Apr 12 21:44:40 2000 12 00avr34 10 189.67 100.01 72112 881028 71 21.805 Wed Apr 12 21:47:00 2000 .............
sum mode and complex match
In this case the matching string has to be quoted and need to be a regular perl
expression. The following look at *avr392*, *avr393*, *avr394* image names.
It shows that the image 00avr393 was first taken on sample 12, but the operator probably kill it, restart it once for two frames of ten seconds before starting the same image for 10 frames. It is obvious that the first images have been overwriten if they are on the same path.
d2mat2(berar)~/progs/Img> wspec2xl.pl -m "avr39[2-4]" -S saxsext.12Apr00 ## wspec2xl.pl (Apr.18th,2000) saxsext.12Apr00 Tue Apr 18 11:54:02 2000 ## image name matching ...avr39[2-4]... ## sum mode, no frames output ## sample file frame mA time pm0 pm1 pm2 other date 12 00avr392 10 189.07 100.01 74419 618100 42 23.51 Thu Apr 13 15:53:36 2000 12 00avr393 2 188.11 2.00 1501 17282 1 23.61 Thu Apr 13 16:12:41 2000 1 00avr393 2 187.47 20.00 14684 158253 6 22.98 Thu Apr 13 16:25:14 2000 1 00avr393 10 187.30 100.01 73001 792750 47 22.905 Thu Apr 13 16:27:43 2000 2 00avr394 10 187.15 100.01 73459 858080 58 22.618 Thu Apr 13 16:30:50 2000 .............
The inline help
The commandwspec2xl.pl -h will display its principal key words.
.....> wspec2xl.pl -h
usage: script/wspec2xl.pl [-m"match"|-M"equal"] [-w"wv"] [-bdfqr] [-Qf] [-px] [-cx] [-CXX] ... specfile
usage: script/wspec2xl.pl [-h]
Extract counts from specfile using winview.
-h Help -- just display this message and quit.
-b : beam
-c counters (default=2) : print up to max_counters (0..4.., default=2)
-CXX : specify output format of counters, default -C" %8.0f"
-d : date CA MARCHE PAS???
-e x.y : add the extension x.y to image names in the results
-f counts by frames rather than sum of frames
-F n counts for frame n only(starting at 1), 0 => no_frames
-m xxx : result concern only file names matching *xxx*, xxx can be a regexp (invalid in scan)
-M xxx : result concern only the file with basename *xxx*
-o n : compatibility with old specfile (1<jan02, 2<fev02), -o0 to get info
-O xxx : dedicated output ( dad )
-p positions (default 4) : print up to max_motors (default 4)
-q : HKL , -Qf format (default -Q" %4.2f")
-r raw list as read (includes overwriten images)
-w xxx : result concern only WINxxx identifier (WINSCAN details need -f option)
-x win : result concern only winxxx identifier (by default opt_x='WIN', other choices 'XPAD')
example wspec2xl.pl -m "avr39[89]" saxsext.12Apr00
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: wspec2xl.html,v 1.3 2006/04/12 14:05:28 berar Exp $