aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-07-30 20:32:55 -0700
committerThomas White <taw@bitwiz.org.uk>2012-07-30 20:42:51 -0700
commit0b262aa61f587b69fd46c95841342886580f4946 (patch)
tree995a2619022ac01e0f96611f47eb37adf195641d
parent31f6c26cd344c01e0c329fa812cf78a7ef9dc700 (diff)
Update *2hkl scripts, add cif2hkl
-rw-r--r--Makefile.am4
-rwxr-xr-xscripts/cif2hkl28
-rwxr-xr-xscripts/hkl2hkl13
-rwxr-xr-xscripts/mtz2hkl7
4 files changed, 43 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index c923a9c7..8ea4752a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -132,7 +132,7 @@ script_DATA = scripts/check-near-bragg scripts/random-image \
scripts/alternate-stream scripts/README scripts/cell-please \
scripts/check-hkl-completeness.gp scripts/check-hkl-quality.gp \
scripts/compare-hkl.gp scripts/check-peak-detection \
- scripts/indexed-filenames scripts/gen-sfs
+ scripts/indexed-filenames scripts/gen-sfs scripts/cif2hkl
EXTRA_DIST += scripts/check-near-bragg scripts/random-image \
scripts/wibbletron scripts/create-mtz scripts/mtz2hkl \
@@ -140,7 +140,7 @@ EXTRA_DIST += scripts/check-near-bragg scripts/random-image \
scripts/alternate-stream scripts/README scripts/cell-please \
scripts/check-hkl-completeness.gp scripts/check-hkl-quality.gp \
scripts/compare-hkl.gp scripts/check-peak-detection \
- scripts/indexed-filenames scripts/gen-sfs
+ scripts/indexed-filenames scripts/gen-sfs scripts/cif2hkl
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
diff --git a/scripts/cif2hkl b/scripts/cif2hkl
new file mode 100755
index 00000000..8d82726c
--- /dev/null
+++ b/scripts/cif2hkl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+my $line;
+
+printf(" h k l I phase sigma(I) counts"
+ ." fs/px ss/px\n");
+
+while ( $line = <STDIN> ) {
+
+ if ( $line =~ /([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\so\s+[\d\.\-]+\s+[\d\.\-]+\s+([\d\.\-]+)\s+([\d\.\-]+)\s+$/ ) {
+
+ my $h = $1;
+ my $k = $2;
+ my $l = $3;
+ 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("End of reflections\n");
diff --git a/scripts/hkl2hkl b/scripts/hkl2hkl
index 70757d50..a9dfab13 100755
--- a/scripts/hkl2hkl
+++ b/scripts/hkl2hkl
@@ -4,20 +4,25 @@ use strict;
my $line;
-printf(" h k l I phase sigma(I) 1/d(nm^-1) counts\n");
+printf(" h k l I phase sigma(I) counts"
+ ." fs/px ss/px\n");
while ( $line = <STDIN> ) {
- if ( $line =~ /^\s*([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\s+([\d\.\-]+)\s+/ ) {
+ if ( $line =~ /([\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("%3i %3i %3i %10.2f %s %10.2f %10.2f %7i\n",
- $h, $k, $l, $intensity, " -", 0.0, 0.0, 1);
+ 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("End of reflections\n");
diff --git a/scripts/mtz2hkl b/scripts/mtz2hkl
index e0ea1e3a..507f75c8 100755
--- a/scripts/mtz2hkl
+++ b/scripts/mtz2hkl
@@ -1,7 +1,8 @@
#!/bin/sh
mtz2various hklin $1 hklout $2 <<EOF
-LABIN H=H K=K L=L FP=FP
-FSQUARED
-OUTPUT USER '(3I4,F9.1)'
+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"