aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-04-01 07:28:35 -0700
committerThomas White <taw@physics.org>2015-04-01 16:31:14 +0200
commit8d0df62255f44c912fb24fc648e78402dbff6155 (patch)
treeb1a5d8e910f040c6400f37c857b55fbafd88cfeb /scripts
parent71c1b01de8c6094337a1d1cb9a3d6eb5a31efdbb (diff)
Add scripts/crystal-frame-number
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/crystal-frame-number24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/crystal-frame-number b/scripts/crystal-frame-number
new file mode 100755
index 00000000..b3ed3f1f
--- /dev/null
+++ b/scripts/crystal-frame-number
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+import sys
+
+f = open(sys.argv[1])
+
+frame_number = 0
+crystal_number = 0
+
+while True:
+ fline = f.readline()
+ if not fline:
+ break
+ if fline.find("Image filename") != -1:
+ frame_number += 1
+ fn = fline.split(': ')[1].split(' ')[0].rstrip("\r\n")
+ print 'Frame %i: %s' % (frame_number, fn)
+ if fline.find("diffraction_resolution_limit") != -1:
+ crystal_number += 1
+ print ' Crystal %i: %s' % (crystal_number, fline.rstrip("\r\n"))
+
+f.close()