From 29f05a21f0782201751e8ad5ff78b42836979f73 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 3 Mar 2014 17:03:28 +0100 Subject: Update scripts for new reflection list format --- scripts/cif2hkl | 8 +++----- scripts/create-xscale | 8 +++++--- scripts/gen-sfs | 6 +++--- scripts/gen-sfs-ano | 11 ++++++----- scripts/hkl2hkl | 10 +++++----- scripts/mtz2hkl | 33 +++++++++++++++++++++++++++++++-- 6 files changed, 53 insertions(+), 23 deletions(-) diff --git a/scripts/cif2hkl b/scripts/cif2hkl index 8d82726c..f03b1b69 100755 --- a/scripts/cif2hkl +++ b/scripts/cif2hkl @@ -4,8 +4,7 @@ use strict; my $line; -printf(" h k l I phase sigma(I) counts" - ." fs/px ss/px\n"); +printf(" h k l I phase sigma(I) nmeas\n"); while ( $line = ) { @@ -17,9 +16,8 @@ while ( $line = ) { my $intensity = $4; my $sigi = $5; - printf("%3i %3i %3i %10.2f %s %10.2f %7i %6.1f %6.1f\n", - $h, $k, $l, $intensity, " -", $sigi, - 1, 0.0, 0.0); + printf("%4i %4i %4i %10.2f %s %10.2f %7i\n", + $h, $k, $l, $intensity, " -", $sigi, 1); } diff --git a/scripts/create-xscale b/scripts/create-xscale index aca5aab2..6d9def4a 100755 --- a/scripts/create-xscale +++ b/scripts/create-xscale @@ -2,8 +2,10 @@ use strict; -# When you've edited the relevant parameters, delete this comment and the following two lines -printf("You need to edit this script first, to set the space group and cell parameters.\n"); +# When you've edited the relevant parameters, delete this comment and the +# following two lines +printf("You need to edit this script first, to set the space group and ". + "cell parameters.\n"); exit(1); open(FH, $ARGV[0]); @@ -31,7 +33,7 @@ while ( $line = ) { my $k = $2; my $l = $3; my $int = $4; - my $sig = $6; + my $sig = $6; # Yes, it's meant to be $6 not $5 ($5 is phase) printf("%6i %6i %5i %9.2f %9.2f\n", $h, $k, $l, $int, $sig); diff --git a/scripts/gen-sfs b/scripts/gen-sfs index 7cc20014..99216cf6 100755 --- a/scripts/gen-sfs +++ b/scripts/gen-sfs @@ -61,7 +61,7 @@ use strict; my \$line; open(FILE, "${PDB}-temp.hkl"); -printf(" h k l I phase sigma(I) counts fs/px ss/px\\n"); +printf(" h k l I phase sigma(I) nmeas\n"); while ( \$line = ) { @@ -73,8 +73,8 @@ while ( \$line = ) { my \$intensity = \$4*\$4; # Square to convert F->I my \$phase = \$5; - printf("%3i %3i %3i %10.2f %8.2f %10.2f %7i %6.1f %6.1f\n", - \$h, \$k, \$l, \$intensity, \$phase, 0.0, 1, 0.0, 0.0); + printf("%4i %4i %4i %10.2f %s %10.2f %7i\n", + \$h, \$k, \$l, \$intensity, " -", \$sigi, 1); } else { printf(STDERR "Couldn't understand line '%s'\n", \$line); diff --git a/scripts/gen-sfs-ano b/scripts/gen-sfs-ano index 1b2e8374..0b2fa5b5 100755 --- a/scripts/gen-sfs-ano +++ b/scripts/gen-sfs-ano @@ -48,7 +48,7 @@ use strict; my \$line; open(FILE, "${PDB}-temp1.hkl"); -printf(" h k l I phase sigma(I) counts fs/px ss/px\\n"); +printf(" h k l I phase sigma(I) nmeas\n"); while ( \$line = ) { @@ -59,12 +59,13 @@ while ( \$line = ) { my \$l = \$3; my \$iplus = \$4*\$4; # Square to convert F->I my \$iminus = \$5*\$5; + my \$sigi = 0.0; - printf("%3i %3i %3i %10.2f - 0.0 %s %7i %6.1f %6.1f\n", - \$h, \$k, \$l, \$iplus, 1, 0.0, 0.0); + printf("%4i %4i %4i %10.2f %s %10.2f %7i\n", + \$h, \$k, \$l, \$iplus, " -", \$sigi, 1); - printf("%3i %3i %3i %10.2f - 0.0 %s %7i %6.1f %6.1f\n", - -\$h, -\$k, -\$l, \$iminus, 1, 0.0, 0.0); + printf("%4i %4i %4i %10.2f %s %10.2f %7i\n", + -\$h, -\$k, -\$l, \$iminus, " -", \$sigi, 1); } else { printf(STDERR "Couldn't understand line '%s'\n", \$line); diff --git a/scripts/hkl2hkl b/scripts/hkl2hkl index a9dfab13..1557bfd7 100755 --- a/scripts/hkl2hkl +++ b/scripts/hkl2hkl @@ -4,20 +4,20 @@ use strict; my $line; -printf(" h k l I phase sigma(I) counts" - ." fs/px ss/px\n"); +printf(" h k l I phase sigma(I) nmeas\n"); while ( $line = ) { - if ( $line =~ /([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\s+([\d\.\-]+)\s+([\d\.\-]+)/ ) { + if ( $line =~ /([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\s+([\d\.\-]+)\s+([\d\.\-]+)\s+([\d\.\-]+)/ ) { my $h = $1; my $k = $2; my $l = $3; my $intensity = $4; - my $sigi = $5; + my $phase = $5; + my $sigi = $6; - printf("%3i %3i %3i %10.2f %s %10.2f %7i %6.1f %6.1f\n", + printf("%4i %4i %4i %10.2f %s %10.2f %7i\n", $h, $k, $l, $intensity, " -", $sigi, 1, 0.0, 0.0); diff --git a/scripts/mtz2hkl b/scripts/mtz2hkl index 507f75c8..56a5fce1 100755 --- a/scripts/mtz2hkl +++ b/scripts/mtz2hkl @@ -1,8 +1,37 @@ #!/bin/sh -mtz2various hklin $1 hklout $2 < $2 << WIBBLE +use strict; + +my \$line; +open(FILE, "$2.temp"); + +printf(" h k l I phase sigma(I) nmeas\n"); + +while ( \$line = ) { + + if ( \$line =~ /^\s*([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\s+([\d\-\.]+)\s+([\d\-\.]+)/ ) { + + my \$h = \$1; + my \$k = \$2; + my \$l = \$3; + my \$intensity = \$4; + my \$sigi = \$5; + + printf("%4i %4i %4i %10.2f %s %10.2f %7i\n", + \$h, \$k, \$l, \$intensity, " -", \$sigi, 1); + + } else { + printf(STDERR "Couldn't understand line '%s'\n", \$line); + } + +} +close(FILE); +printf("End of reflections\n"); +WIBBLE +exit -- cgit v1.2.3