aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-24 17:13:49 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:59 +0100
commitf062338ad3177a118e75f72739f90c8df7c38fa4 (patch)
treea77cd56b21dab9eda9209caa605fb80dc1ab175d /scripts
parent53ff9bcb0f5da822658a9f3b4e2ae602c4ec2b35 (diff)
Add scripts/create-xscale
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-xscale40
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/create-xscale b/scripts/create-xscale
new file mode 100755
index 00000000..17dc6280
--- /dev/null
+++ b/scripts/create-xscale
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+open(FH, $ARGV[0]);
+
+printf("!FORMAT=XDS_ASCII MERGE=TRUE FRIEDEL'S_LAW=TRUE\n");
+printf("!SPACE_GROUP_NUMBER=182\n");
+printf("!UNIT_CELL_CONSTANTS= 281.00 281.00 165.00 90.000 90.000 120.000\n");
+printf("!NUMBER_OF_ITEMS_IN_EACH_DATA_RECORD=5\n");
+printf("!X-RAY_WAVELENGTH= -1.0\n");
+printf("!ITEM_H=1\n");
+printf("!ITEM_K=2\n");
+printf("!ITEM_L=3\n");
+printf("!ITEM_IOBS=4\n");
+printf("!ITEM_SIGMA(IOBS)=5\n");
+printf("!END_OF_HEADER\n");
+
+my $line;
+while ( $line = <FH> ) {
+
+ chomp($line);
+
+ if ( $line =~ /^\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9\.\-]+)/ ) {
+
+ my $h = $1;
+ my $k = $2;
+ my $l = $3;
+ my $int = $4;
+
+ my $err = 179.0 * sqrt(abs($int)/179.0);
+
+ printf("%6i %6i %5i %9.2f %9.2f\n", $h, $k, $l, $int, $err);
+ }
+
+}
+
+printf("!END_OF_DATA");
+
+close(FH);