improved the regex for header reading
This commit is contained in:
parent
31aded8311
commit
596ee18da9
|
@ -348,13 +348,14 @@ options.scaling = map(float, options.scaling)
|
||||||
if numpy.any(options.scaling != 1.0) and options.linearreconstruction: print 'cannot scale for linear reconstruction'
|
if numpy.any(options.scaling != 1.0) and options.linearreconstruction: print 'cannot scale for linear reconstruction'
|
||||||
if numpy.any(options.scaling != 1.0) and options.filenodalcoords != '': print 'cannot scale when reading coordinate from file'
|
if numpy.any(options.scaling != 1.0) and options.filenodalcoords != '': print 'cannot scale when reading coordinate from file'
|
||||||
options.separator = options.separator.lower()
|
options.separator = options.separator.lower()
|
||||||
|
|
||||||
for filename in args:
|
for filename in args:
|
||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
continue
|
continue
|
||||||
file = open(filename)
|
file = open(filename)
|
||||||
content = file.readlines()
|
content = file.readlines()
|
||||||
file.close()
|
file.close()
|
||||||
m = re.search('(\d+)\shead',content[0],re.I)
|
m = re.search('(\d+)\s*head', content[0].lower())
|
||||||
if m == None:
|
if m == None:
|
||||||
continue
|
continue
|
||||||
print filename,'\n'
|
print filename,'\n'
|
||||||
|
@ -442,7 +443,7 @@ for filename in args:
|
||||||
dim[2] = min(dim/grid)
|
dim[2] = min(dim/grid)
|
||||||
else:
|
else:
|
||||||
dim[2] = options.unitlength
|
dim[2] = options.unitlength
|
||||||
|
print dim
|
||||||
if options.undeformed:
|
if options.undeformed:
|
||||||
Favg = numpy.eye(3)
|
Favg = numpy.eye(3)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue