aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/cif2hkl8
-rwxr-xr-xscripts/create-xscale8
-rwxr-xr-xscripts/gen-sfs6
-rwxr-xr-xscripts/gen-sfs-ano11
-rwxr-xr-xscripts/hkl2hkl10
-rwxr-xr-xscripts/mtz2hkl33
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 = <STDIN> ) {
@@ -17,9 +16,8 @@ while ( $line = <STDIN> ) {
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 = <FH> ) {
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 = <FILE> ) {
@@ -73,8 +73,8 @@ while ( \$line = <FILE> ) {
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 = <FILE> ) {
@@ -59,12 +59,13 @@ while ( \$line = <FILE> ) {
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 = <STDIN> ) {
- 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 <<EOF
+mtz2various hklin $1 hklout $2.temp <<EOF
LABIN H=H K=K L=L I=IMEAN SIGI=SIGIMEAN
OUTPUT USER '(3I4,2F15.1)'
EOF
-echo "Now use hkl2hkl (without modification) to convert $2 to a CrystFEL file"
+perl < $2.temp > $2 << WIBBLE
+use strict;
+
+my \$line;
+open(FILE, "$2.temp");
+
+printf(" h k l I phase sigma(I) nmeas\n");
+
+while ( \$line = <FILE> ) {
+
+ 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