From 5d9abc16e8f4ac18ecb98ac52afcaaaadb1f018c Mon Sep 17 00:00:00 2001 From: Haiming Zhang Date: Thu, 5 Mar 2015 20:16:17 +0000 Subject: [PATCH] the number of grains starts with one. --- processing/pre/hybridIA_linODFsampling.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/processing/pre/hybridIA_linODFsampling.py b/processing/pre/hybridIA_linODFsampling.py index b64801733..6f0c8661c 100755 --- a/processing/pre/hybridIA_linODFsampling.py +++ b/processing/pre/hybridIA_linODFsampling.py @@ -372,9 +372,9 @@ for method in methods: fileConfig.write('#-------------------#\n') for i,ID in enumerate(xrange(nSamples)): - fileConfig.write('[Grain%s]\n'%(str(ID).zfill(formatwidth)) + \ + fileConfig.write('[Grain%s]\n'%(str(ID+1).zfill(formatwidth)) + \ 'crystallite %i\n'%options.crystallite + \ - '(constituent) phase %i texture %s fraction 1.0\n'%(options.phase,str(ID).rjust(formatwidth))) + '(constituent) phase %i texture %s fraction 1.0\n'%(options.phase,str(ID+1).rjust(formatwidth))) fileConfig.write('\n#-------------------#') fileConfig.write('\n\n') @@ -382,9 +382,9 @@ for method in methods: for ID in xrange(nSamples): eulers = re.split(r'[\t]', Orientations[method][ID].strip()) - fileConfig.write('[Grain%s]\n'%(str(ID).zfill(formatwidth)) + \ + fileConfig.write('[Grain%s]\n'%(str(ID+1).zfill(formatwidth)) + \ '(gauss) phi1 %10.5f Phi %10.5f phi2 %10.6f scatter 0.0 fraction 1.0\n'\ %(float(eulers[0]),float(eulers[1]),float(eulers[2]))) fileConfig.close() except: - print 'unable to write material .config file:', nameSampledODF+'.'+method+str(nSamples)+'.config' \ No newline at end of file + print 'unable to write material.config file:', nameSampledODF+'.'+method+str(nSamples)+'.config'