ensure that data is correctly ordered

This commit is contained in:
Martin Diehl 2019-12-08 18:13:20 +01:00
parent 8d0c4310cf
commit 828e82605e
5 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ for name in filenames:
damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size = damask.util.coordGridAndSize(table.get(options.pos))
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos),True)
for label in options.labels:
field = table.get(label)

View File

@ -50,7 +50,7 @@ for name in filenames:
damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size = damask.util.coordGridAndSize(table.get(options.pos))
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos),True)
F = table.get(options.f).reshape(np.append(grid[::-1],(3,3)))
if options.nodal:

View File

@ -44,7 +44,7 @@ for name in filenames:
damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size = damask.util.coordGridAndSize(table.get(options.pos))
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos),True)
for label in options.labels:
field = table.get(label)

View File

@ -44,7 +44,7 @@ for name in filenames:
damask.util.report(scriptName,name)
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
grid,size = damask.util.coordGridAndSize(table.get(options.pos))
grid,size,origin = damask.grid_filters.cell_coord0_2_DNA(table.get(options.pos),True)
for label in options.labels:
field = table.get(label)

View File

@ -102,7 +102,7 @@ def cell_coord0_2_DNA(coord0,ordered=False):
raise ValueError('Data count {} does not match grid {}.'.format(len(coord0),grid))
start = origin + delta*.5
end = origin + size -delta*.5
end = origin - delta*.5 + size
if not np.allclose(coords[0],np.linspace(start[0],end[0],grid[0])) and \
np.allclose(coords[1],np.linspace(start[1],end[1],grid[1])) and \