From 3ae8b0f73273fa78ca27a3c9e1b82a2884bfc52e Mon Sep 17 00:00:00 2001 From: Nan Jia Date: Tue, 24 May 2011 17:23:22 +0000 Subject: [PATCH] dropped grain index from output header (did not work anyhow) introduced string escape for the likes of MPIE\n.jia to prevent newline literal --- processing/post/postResults | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/processing/post/postResults b/processing/post/postResults index 64e6163f9..160f944ce 100755 --- a/processing/post/postResults +++ b/processing/post/postResults @@ -1,6 +1,6 @@ #!/usr/bin/env python -import pdb, os, sys, gc, math, re, threading, time, struct +import pdb, os, sys, gc, math, re, threading, time, struct, string from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP releases = {'2010':['linux64',''], @@ -925,8 +925,8 @@ for incCount,increment in enumerate(increments): file = open(outFilename,'w') fileOpen = True file.write('2\theader\n') - file.write('$Id$\t'+\ - ' '.join(sys.argv[1:]) + '\n') + file.write(string.replace('$Id$','\n','\\n')+ + '\t' + ' '.join(sys.argv[1:]) + '\n') headerWritten = False file.flush() @@ -977,11 +977,10 @@ for incCount,increment in enumerate(increments): ): outputIndex = list(zip(*outputFormat[resultType]['outputs'])[0]).index(label) # find the position of this output in the outputFormat length = int(outputFormat[resultType]['outputs'][outputIndex][1]) - if resultType == 'Homogenization': - thisHead = heading('_',[[component,label] for component in range(int(length>1),length+int(length>1))]) - else: - thisHead = heading('_',[[g,component,label] for component in range(int(length>1),length+int(length>1))]) + thisHead = heading('_',[[component,label] for component in range(int(length>1),length+int(length>1))]) if assembleHeader: header += thisHead + if resultType != 'Homogenization': + thisHead = heading('_',[[g,component,label] for component in range(int(length>1),length+int(length>1))]) newby.append({'label':label, 'len':length, 'content':[ p.element_scalar(p.element_sequence(e),stat['IndexOfLabel'][head])[n_local].value @@ -990,7 +989,7 @@ for incCount,increment in enumerate(increments): assembleHeader = False if N == 0: - mappedResult = [float(x) for x in xrange(len(header))] + mappedResult = [float(x) for x in xrange(len(header))] # initialize with debug data (should get deleted by *N at N=0) pos = 0 for chunk in newby: