added conversion of 'resolution' in result file to integer array
This commit is contained in:
parent
096a4803b0
commit
2f47d4b09b
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue