renamed "coordinates" option to "position". small additional polishing.
This commit is contained in:
parent
10e31e489a
commit
8c0b0351cd
|
@ -88,16 +88,27 @@ Add column(s) containing Euclidean distance to grain structural features: bounda
|
||||||
|
|
||||||
""", version = scriptID)
|
""", version = scriptID)
|
||||||
|
|
||||||
parser.add_option('-c','--coordinates', dest='coords', metavar='string',
|
parser.add_option('-p',
|
||||||
help='column label of coordinates [%default]')
|
'--pos', '--position',
|
||||||
parser.add_option('-i','--identifier', dest='id', metavar = 'string',
|
dest = 'coords', metavar = 'string',
|
||||||
help='column label of grain identifier [%default]')
|
help = 'label of coordinates [%default]')
|
||||||
parser.add_option('-t','--type', dest = 'type', action = 'extend', metavar = '<string LIST>',
|
parser.add_option('-i',
|
||||||
help = 'feature type {%s} '%(', '.join(map(lambda x:'/'.join(x['names']),features))) )
|
'--id', '--identifier',
|
||||||
parser.add_option('-n','--neighborhood',dest='neighborhood', choices = neighborhoods.keys(), metavar = 'string',
|
dest = 'id', metavar = 'string',
|
||||||
help = 'type of neighborhood [neumann] {%s}'%(', '.join(neighborhoods.keys())))
|
help='label of grain identifier [%default]')
|
||||||
parser.add_option('-s', '--scale', dest = 'scale', type = 'float', metavar = 'float',
|
parser.add_option('-t',
|
||||||
|
'--type',
|
||||||
|
dest = 'type', action = 'extend', metavar = '<string LIST>',
|
||||||
|
help = 'feature type {{{}}} '.format(', '.join(map(lambda x:'/'.join(x['names']),features))) )
|
||||||
|
parser.add_option('-n',
|
||||||
|
'--neighborhood',
|
||||||
|
dest = 'neighborhood', choices = neighborhoods.keys(), metavar = 'string',
|
||||||
|
help = 'neighborhood type [neumann] {{{}}}'.format(', '.join(neighborhoods.keys())))
|
||||||
|
parser.add_option('-s',
|
||||||
|
'--scale',
|
||||||
|
dest = 'scale', type = 'float', metavar = 'float',
|
||||||
help = 'voxel size [%default]')
|
help = 'voxel size [%default]')
|
||||||
|
|
||||||
parser.set_defaults(coords = 'pos',
|
parser.set_defaults(coords = 'pos',
|
||||||
id = 'texture',
|
id = 'texture',
|
||||||
neighborhood = 'neumann',
|
neighborhood = 'neumann',
|
||||||
|
@ -111,7 +122,7 @@ if options.type is None:
|
||||||
if not set(options.type).issubset(set(list(itertools.chain(*map(lambda x: x['names'],features))))):
|
if not set(options.type).issubset(set(list(itertools.chain(*map(lambda x: x['names'],features))))):
|
||||||
parser.error('type must be chosen from (%s).'%(', '.join(map(lambda x:'|'.join(x['names']),features))) )
|
parser.error('type must be chosen from (%s).'%(', '.join(map(lambda x:'|'.join(x['names']),features))) )
|
||||||
if 'biplane' in options.type and 'boundary' in options.type:
|
if 'biplane' in options.type and 'boundary' in options.type:
|
||||||
parser.error("only one from aliases 'biplane' and 'boundary' possible.")
|
parser.error('only one from aliases "biplane" and "boundary" possible.')
|
||||||
|
|
||||||
feature_list = []
|
feature_list = []
|
||||||
for i,feature in enumerate(features):
|
for i,feature in enumerate(features):
|
||||||
|
@ -172,9 +183,7 @@ for name in filenames:
|
||||||
|
|
||||||
N = grid.prod()
|
N = grid.prod()
|
||||||
|
|
||||||
if N != len(table.data): errors.append('data count {} does not match grid '.format(N) +
|
if N != len(table.data): errors.append('data count {} does not match grid {}.'.format(N,'x'.join(map(str,grid))))
|
||||||
'x'.join(map(str,grid)) +
|
|
||||||
'.')
|
|
||||||
if errors != []:
|
if errors != []:
|
||||||
damask.util.croak(errors)
|
damask.util.croak(errors)
|
||||||
table.close(dismiss = True)
|
table.close(dismiss = True)
|
||||||
|
|
Loading…
Reference in New Issue