diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | scripts/crystal-frame-number | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 75d0e98e..10aafcbf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -181,7 +181,7 @@ script_DATA = scripts/alternate-stream scripts/cell-please \ scripts/clean-stream.py scripts/fg-graph scripts/truncate-stream \ scripts/gen-sfs-expand scripts/add-beam-params \ scripts/find-pairs scripts/plot-cc-and-scale.R \ - scripts/ave-resolution + scripts/ave-resolution scripts/crystal-frame-number EXTRA_DIST += $(script_DATA) 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() |