diff options
author | Thomas White <taw@physics.org> | 2011-03-30 17:28:54 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:23 +0100 |
commit | 0636814cc2c360fd9f37a1f7fe3e2be04cee8377 (patch) | |
tree | 1c42e92d3b8febd15e0a4bf6801bcc4be29163a0 /scripts/double-hit | |
parent | e0ec9d63f7747b47ab516c701fd55ffe977031a7 (diff) |
Clean up old, useless and broken scripts
Diffstat (limited to 'scripts/double-hit')
-rwxr-xr-x | scripts/double-hit | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/scripts/double-hit b/scripts/double-hit deleted file mode 100755 index 55a95ee1..00000000 --- a/scripts/double-hit +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use File::Basename; - -open(FH, $ARGV[0]); -open(OFH, "> doublehit.dat"); - -my $line; -my $filename; -my $full_filename; - -my $hsteps = 128; -my @hist; -my $hmin = 0; -my $hmax = 5; -my $hstep = ($hmax - $hmin)/$hsteps; - -for ( my $i=0; $i<$hsteps; $i++ ) { - $hist[$i] = 0; -} - -while ( $line = <FH> ) { - - if ( $line =~ /^Reflections\ from\ indexing\ in\ (.+)$/ ) { - $full_filename = $1; - $filename = basename($full_filename); - } - - if ( $line =~ /^Peak\ statistics:\ (\d+)\ .*\ (\d+)\ .*\ (\d+)\ .*\ (\d+)\ / ) { - - my $foundclose = $1; - my $found = $2; - my $indclose = $3; - my $hits = $3; - - $filename =~ /LCLS_(\d+)_([A-Za-z]+)(\d+)_r\d+_(\d\d)(\d\d)(\d\d)_/; - my $year = $1; - my $month = $2; - my $day = $3; - my $hour = $4; - my $min = $5; - my $sec = $6; - - my $div; - - if ( $foundclose > 0 ) { - $div = $found / $foundclose; - } else { - $div = 0.0; - } - - printf(OFH "%s/%s/%s-%s:%s:%s %f\n", $year, $month, $day, - $hour, $min, $sec, - $div); - - if ( $div > 4.0 ) { - printf("Double hit: %s\n", $full_filename); - } - if ( $div == 1.0 ) { - printf("Single hit: %s\n", $full_filename); - } - - my $bin = int(($div-$hmin)/$hstep); - $hist[$bin]++; - } - -} - -close(FH); -close(OFH); - -open(GP, "| gnuplot"); - -print(GP "set term postscript enhanced font \"Helvetica,20\"\n"); -print(GP "set output \"doublehit.ps\"\n"); -print(GP "set xtics nomirror out rotate by -60\n"); -print(GP "set xdata time\n"); -print(GP "set timefmt \"%Y/%b/%d-%H:%M:%S\"\n"); -print(GP "set format x \"%d/%b %H:%M\"\n"); -print(GP "unset key\n"); -print(GP "plot [] [0:5] \"doublehit.dat\" u 1:2 w points\n"); - -open(OFH, "> doublehit-hist.dat"); -for ( my $i=0; $i<$hsteps; $i++ ) { - printf(OFH "%f %f\n", $hmin+$hstep*$i+($hstep/2), $hist[$i]); -} -close(OFH); - -print(GP "set xtics nomirror out rotate by 0\n"); -print(GP "unset xdata\n"); -print(GP "set format x \"% g\"\n"); -print(GP "unset key\n"); -print(GP "plot [] [0:1000] \"doublehit-hist.dat\" u 1:2 w histeps\n"); - -close(GP); - -system("ps2pdf doublehit.ps"); -unlink("doublehit.dat"); -unlink("doublehit.ps"); |