1
2
3
4 """
5 Extracts a single file from a recalibration log.
6
7 @author: N.J. Cross
8 @org: WFAU, IfA, University of Edinburgh
9 """
10
11 import sys
12
13
14 if __name__ == '__main__':
15 logFilePath=sys.argv[1]
16 testFileName=sys.argv[2]
17 testLogFilePath=sys.argv[3]
18
19 lines = open(logFilePath).readlines()
20 for index, line in enumerate(lines):
21 if testFileName in line:
22 break
23 else:
24 raise SystemExit(testFileName + " not found in " + logFilePath)
25
26 open(testLogFilePath, 'w').writelines(lines[index:index+32])
27