fixed bug in output of origin (reported size instead)
This commit is contained in:
parent
fafa69b846
commit
f75604c235
|
@ -5,6 +5,9 @@ import os,sys,string,re,math,numpy
|
||||||
import damask
|
import damask
|
||||||
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
|
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
|
||||||
|
|
||||||
|
scriptID = '$Id$'
|
||||||
|
scriptName = scriptID.split()[1]
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
class extendedOption(Option):
|
class extendedOption(Option):
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
|
@ -46,7 +49,7 @@ mappings = {
|
||||||
|
|
||||||
parser = OptionParser(option_class=extendedOption, usage='%prog options [file[s]]', description = """
|
parser = OptionParser(option_class=extendedOption, usage='%prog options [file[s]]', description = """
|
||||||
Changes the (three-dimensional) canvas of a spectral geometry description.
|
Changes the (three-dimensional) canvas of a spectral geometry description.
|
||||||
""" + string.replace('$Id$','\n','\\n')
|
""" + string.replace(scriptID,'\n','\\n')
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_option('-g', '--grid', dest='grid', type='string', nargs = 3, \
|
parser.add_option('-g', '--grid', dest='grid', type='string', nargs = 3, \
|
||||||
|
@ -81,7 +84,8 @@ else:
|
||||||
|
|
||||||
#--- loop over input files ------------------------------------------------------------------------
|
#--- loop over input files ------------------------------------------------------------------------
|
||||||
for file in files:
|
for file in files:
|
||||||
if file['name'] != 'STDIN': file['croak'].write(file['name']+'\n')
|
if file['name'] != 'STDIN': file['croak'].write('\033[1m'+scriptName+'\033[0m: '+file['name']+'\n')
|
||||||
|
else: file['croak'].write('\033[1m'+scriptName+'\033[0m\n')
|
||||||
|
|
||||||
theTable = damask.ASCIItable(file['input'],file['output'],labels=False)
|
theTable = damask.ASCIItable(file['input'],file['output'],labels=False)
|
||||||
theTable.head_read()
|
theTable.head_read()
|
||||||
|
@ -180,7 +184,7 @@ for file in files:
|
||||||
if (any(newInfo['size'] != info['size'])):
|
if (any(newInfo['size'] != info['size'])):
|
||||||
file['croak'].write('--> size x y z: %s\n'%(' x '.join(map(str,newInfo['size']))))
|
file['croak'].write('--> size x y z: %s\n'%(' x '.join(map(str,newInfo['size']))))
|
||||||
if (any(newInfo['origin'] != info['origin'])):
|
if (any(newInfo['origin'] != info['origin'])):
|
||||||
file['croak'].write('--> origin x y z: %s\n'%(' : '.join(map(str,newInfo['size']))))
|
file['croak'].write('--> origin x y z: %s\n'%(' : '.join(map(str,newInfo['origin']))))
|
||||||
if (newInfo['microstructures'] != info['microstructures']):
|
if (newInfo['microstructures'] != info['microstructures']):
|
||||||
file['croak'].write('--> microstructures: %i\n'%newInfo['microstructures'])
|
file['croak'].write('--> microstructures: %i\n'%newInfo['microstructures'])
|
||||||
|
|
||||||
|
@ -195,7 +199,7 @@ for file in files:
|
||||||
theTable.labels_clear()
|
theTable.labels_clear()
|
||||||
theTable.info_clear()
|
theTable.info_clear()
|
||||||
theTable.info_append(extra_header+[
|
theTable.info_append(extra_header+[
|
||||||
"$Id$",
|
scriptID,
|
||||||
"grid\ta %i\tb %i\tc %i"%(newInfo['grid'][0],newInfo['grid'][1],newInfo['grid'][2],),
|
"grid\ta %i\tb %i\tc %i"%(newInfo['grid'][0],newInfo['grid'][1],newInfo['grid'][2],),
|
||||||
"size\tx %f\ty %f\tz %f"%(newInfo['size'][0],newInfo['size'][1],newInfo['size'][2],),
|
"size\tx %f\ty %f\tz %f"%(newInfo['size'][0],newInfo['size'][1],newInfo['size'][2],),
|
||||||
"origin\tx %f\ty %f\tz %f"%(newInfo['origin'][0],newInfo['origin'][1],newInfo['origin'][2],),
|
"origin\tx %f\ty %f\tz %f"%(newInfo['origin'][0],newInfo['origin'][1],newInfo['origin'][2],),
|
||||||
|
|
Loading…
Reference in New Issue