From 2f47d4b09be5bc835f7d7c1f0e894a2978cb9a30 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 2 Dec 2010 14:53:17 +0000 Subject: [PATCH] added conversion of 'resolution' in result file to integer array --- processing/post/spectral_post.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/processing/post/spectral_post.py b/processing/post/spectral_post.py index 05311a5c0..67d7dfb11 100644 --- a/processing/post/spectral_post.py +++ b/processing/post/spectral_post.py @@ -1,8 +1,10 @@ -import binascii +import array +import struct print('post processing for mpie_spectral') -results = open('results.out', 'rb') - +filename ='results.out' +results = open(filename, 'rb') +print('filename:', filename) header = results.read(4) #read header begin = results.tell() @@ -22,7 +24,7 @@ end = results.read(1024).find(header) #find header (second time) results.seek(begin+11) #position: header + string "workingdir " workingdir = results.read(end -11) print('workingdir:', workingdir) -# + results.seek(begin+end+4) header = results.read(4) @@ -32,8 +34,17 @@ results.seek(begin+8) #position: header + string "workingdir " jobname = results.read(end -8) print('jobname:', jobname) -header = b'a' -results.seek(begin+end+19) -print(results.seek(begin+end+19)) -begin = results.read(1024).find(header) -print(begin) +results.seek(results.tell()+4) +header = results.read(4) + + +resolution = array.array('i',[0,0,0]) + +header1 = b'a' +begin = results.seek(results.tell()+11) +begin = begin + results.read(1024).find(header1) +results.seek(begin+1) +resolution[0]=struct.unpack('i',results.read(4))[0] + +print(resolution) +