aboutsummaryrefslogtreecommitdiff
path: root/scripts/eV-to-A
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-11-18 16:36:43 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:41 +0100
commitbd640fa2bbb6bbb219e8dbcdaf88df093cac5c8a (patch)
tree002c2a6d1d5c010f2c6c74975060a5914eee434b /scripts/eV-to-A
parentd5ddfec8d79c9fc829a32cdf51082f626d3184bb (diff)
Stuff related to calculating anomalous structure factors
Diffstat (limited to 'scripts/eV-to-A')
-rwxr-xr-xscripts/eV-to-A10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/eV-to-A b/scripts/eV-to-A
new file mode 100755
index 00000000..941e422b
--- /dev/null
+++ b/scripts/eV-to-A
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+
+my $eV = $ARGV[0];
+
+printf("%5.2f eV\n", $eV);
+
+my $J = $eV*1.6021773e-19;
+my $lambda = (6.62606896e-34 * 299792458)/$J;
+
+printf("%5.2f eV = %5.5f A\n", $eV, $lambda*1e10);