aboutsummaryrefslogtreecommitdiff
path: root/scripts/crystal-frame-number
blob: b3ed3f1f8bf6b32cca675ff92b68b4bcaa7c6a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()