diff --git a/processing/post/addEuclideanDistance.py b/processing/post/addEuclideanDistance.py index b3f972fc7..d99eaaa8c 100755 --- a/processing/post/addEuclideanDistance.py +++ b/processing/post/addEuclideanDistance.py @@ -102,7 +102,7 @@ parser.add_option('-t', help = 'feature type {{{}}} '.format(', '.join(map(lambda x:'/'.join(x['names']),features))) ) parser.add_option('-n', '--neighborhood', - dest = 'neighborhood', choices = neighborhoods.keys(), metavar = 'string', + dest = 'neighborhood', choices = list(neighborhoods.keys()), metavar = 'string', help = 'neighborhood type [neumann] {{{}}}'.format(', '.join(neighborhoods.keys()))) parser.add_option('-s', '--scale', diff --git a/processing/post/addIPFcolor.py b/processing/post/addIPFcolor.py index 2fcc000e1..fd93b45a0 100755 --- a/processing/post/addIPFcolor.py +++ b/processing/post/addIPFcolor.py @@ -116,18 +116,18 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table if inputtype == 'eulers': - o = damask.Orientation(Eulers = np.array(map(float,table.data[column:column+3]))*toRadians, + o = damask.Orientation(Eulers = np.array(list(map(float,table.data[column:column+3])))*toRadians, symmetry = options.symmetry).reduced() elif inputtype == 'matrix': - o = damask.Orientation(matrix = np.array(map(float,table.data[column:column+9])).reshape(3,3).transpose(), + o = damask.Orientation(matrix = np.array(list(map(float,table.data[column:column+9]))).reshape(3,3).transpose(), symmetry = options.symmetry).reduced() elif inputtype == 'frame': - o = damask.Orientation(matrix = np.array(map(float,table.data[column[0]:column[0]+3] + \ + o = damask.Orientation(matrix = np.array(list(map(float,table.data[column[0]:column[0]+3] + \ table.data[column[1]:column[1]+3] + \ - table.data[column[2]:column[2]+3])).reshape(3,3), + table.data[column[2]:column[2]+3]))).reshape(3,3), symmetry = options.symmetry).reduced() elif inputtype == 'quaternion': - o = damask.Orientation(quaternion = np.array(map(float,table.data[column:column+4])), + o = damask.Orientation(quaternion = np.array(list(map(float,table.data[column:column+4]))), symmetry = options.symmetry).reduced() table.data_append(o.IPFcolor(pole)) diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index dc23b351e..e7948c842 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -80,7 +80,7 @@ parser.set_defaults(output = [], (options, filenames) = parser.parse_args() -options.output = map(lambda x: x.lower(), options.output) +options.output = list(map(lambda x: x.lower(), options.output)) if options.output == [] or (not set(options.output).issubset(set(outputChoices))): parser.error('output must be chosen from {}.'.format(', '.join(outputChoices))) @@ -147,21 +147,21 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table if inputtype == 'eulers': - o = damask.Orientation(Eulers = np.array(map(float,table.data[column:column+3]))*toRadians, + o = damask.Orientation(Eulers = np.array(list(map(float,table.data[column:column+3])))*toRadians, symmetry = options.symmetry).reduced() elif inputtype == 'rodrigues': - o = damask.Orientation(Rodrigues= np.array(map(float,table.data[column:column+3])), + o = damask.Orientation(Rodrigues= np.array(list(map(float,table.data[column:column+3]))), symmetry = options.symmetry).reduced() elif inputtype == 'matrix': - o = damask.Orientation(matrix = np.array(map(float,table.data[column:column+9])).reshape(3,3).transpose(), + o = damask.Orientation(matrix = np.array(list(map(float,table.data[column:column+9]))).reshape(3,3).transpose(), symmetry = options.symmetry).reduced() elif inputtype == 'frame': - o = damask.Orientation(matrix = np.array(map(float,table.data[column[0]:column[0]+3] + \ - table.data[column[1]:column[1]+3] + \ - table.data[column[2]:column[2]+3])).reshape(3,3), + o = damask.Orientation(matrix = np.array(list(map(float,table.data[column[0]:column[0]+3] + \ + table.data[column[1]:column[1]+3] + \ + table.data[column[2]:column[2]+3]))).reshape(3,3), symmetry = options.symmetry).reduced() elif inputtype == 'quaternion': - o = damask.Orientation(quaternion = np.array(map(float,table.data[column:column+4])), + o = damask.Orientation(quaternion = np.array(list(map(float,table.data[column:column+4]))), symmetry = options.symmetry).reduced() o.quaternion = r*o.quaternion*R # apply additional lab and crystal frame rotations diff --git a/processing/post/addPK2.py b/processing/post/addPK2.py index 9e6308c39..82898efde 100755 --- a/processing/post/addPK2.py +++ b/processing/post/addPK2.py @@ -75,8 +75,8 @@ for name in filenames: # ------------------------------------------ process data ------------------------------------------ outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table - F = np.array(map(float,table.data[column[options.defgrad]:column[options.defgrad]+9]),'d').reshape(3,3) - P = np.array(map(float,table.data[column[options.stress ]:column[options.stress ]+9]),'d').reshape(3,3) + F = np.array(list(map(float,table.data[column[options.defgrad]:column[options.defgrad]+9])),'d').reshape(3,3) + P = np.array(list(map(float,table.data[column[options.stress ]:column[options.stress ]+9])),'d').reshape(3,3) table.data_append(list(np.dot(np.linalg.inv(F),P).reshape(9))) # [S] =[P].[F-1] outputAlive = table.data_write() # output processed line diff --git a/processing/post/addSchmidfactors.py b/processing/post/addSchmidfactors.py index 4f34621b7..81f240ac1 100755 --- a/processing/post/addSchmidfactors.py +++ b/processing/post/addSchmidfactors.py @@ -252,15 +252,15 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table if inputtype == 'eulers': - o = damask.Orientation(Eulers = np.array(map(float,table.data[column:column+3]))*toRadians,) + o = damask.Orientation(Eulers = np.array(list(map(float,table.data[column:column+3])))*toRadians,) elif inputtype == 'matrix': - o = damask.Orientation(matrix = np.array(map(float,table.data[column:column+9])).reshape(3,3).transpose(),) + o = damask.Orientation(matrix = np.array(list(map(float,table.data[column:column+9]))).reshape(3,3).transpose(),) elif inputtype == 'frame': - o = damask.Orientation(matrix = np.array(map(float,table.data[column[0]:column[0]+3] + \ - table.data[column[1]:column[1]+3] + \ - table.data[column[2]:column[2]+3])).reshape(3,3),) + o = damask.Orientation(matrix = np.array(list(map(float,table.data[column[0]:column[0]+3] + \ + table.data[column[1]:column[1]+3] + \ + table.data[column[2]:column[2]+3]))).reshape(3,3),) elif inputtype == 'quaternion': - o = damask.Orientation(quaternion = np.array(map(float,table.data[column:column+4])),) + o = damask.Orientation(quaternion = np.array(list(map(float,table.data[column:column+4]))),) rotForce = o.quaternion.conjugated() * force rotNormal = o.quaternion.conjugated() * normal diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index b21900c0c..6eea8bee2 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -86,7 +86,7 @@ for name in filenames: while outputAlive and table.data_read(): # read next data line of ASCII table for type, data in items.items(): for column in data['column']: - (u,v) = np.linalg.eigh(np.array(map(float,table.data[column:column+data['dim']])).reshape(data['shape'])) + (u,v) = np.linalg.eigh(np.array(list(map(float,table.data[column:column+data['dim']]))).reshape(data['shape'])) if options.rh and np.dot(np.cross(v[:,0], v[:,1]), v[:,2]) < 0.0 : v[:, 2] *= -1.0 # ensure right-handed eigenvector basis table.data_append(list(u)) # vector of max,mid,min eigval table.data_append(list(v.transpose().reshape(data['dim']))) # 3x3=9 combo vector of max,mid,min eigvec coordinates diff --git a/processing/post/addStrainTensors.py b/processing/post/addStrainTensors.py index 7cb9f3079..14d66d5f6 100755 --- a/processing/post/addStrainTensors.py +++ b/processing/post/addStrainTensors.py @@ -132,7 +132,7 @@ for name in filenames: while outputAlive and table.data_read(): # read next data line of ASCII table for column in items['tensor']['column']: # loop over all requested defgrads - F = np.array(map(float,table.data[column:column+items['tensor']['dim']]),'d').reshape(items['tensor']['shape']) + F = np.array(list(map(float,table.data[column:column+items['tensor']['dim']])),'d').reshape(items['tensor']['shape']) (U,S,Vh) = np.linalg.svd(F) # singular value decomposition R = np.dot(U,Vh) # rotation of polar decomposition stretch['U'] = np.dot(np.linalg.inv(R),F) # F = RU diff --git a/processing/post/rotateData.py b/processing/post/rotateData.py index c5e4882b9..ce8156038 100755 --- a/processing/post/rotateData.py +++ b/processing/post/rotateData.py @@ -100,13 +100,13 @@ for name in filenames: for column in items[datatype]['column']: # loop over all requested labels table.data[column:column+items[datatype]['dim']] = \ - q * np.array(map(float,table.data[column:column+items[datatype]['dim']])) + q * np.array(list(map(float,table.data[column:column+items[datatype]['dim']]))) datatype = 'tensor' for column in items[datatype]['column']: # loop over all requested labels table.data[column:column+items[datatype]['dim']] = \ - np.dot(R,np.dot(np.array(map(float,table.data[column:column+items[datatype]['dim']])).\ + np.dot(R,np.dot(np.array(list(map(float,table.data[column:column+items[datatype]['dim']]))).\ reshape(items[datatype]['shape']),R.transpose())).reshape(items[datatype]['dim']) outputAlive = table.data_write() # output processed line diff --git a/processing/post/vtk2ang.py b/processing/post/vtk2ang.py index 6da07bc02..123dc5b98 100755 --- a/processing/post/vtk2ang.py +++ b/processing/post/vtk2ang.py @@ -421,8 +421,6 @@ for filename in filenames: meshActor.GetProperty().SetOpacity(0.2) meshActor.GetProperty().SetColor(1.0,1.0,0) meshActor.GetProperty().BackfaceCullingOn() - # meshActor.GetProperty().SetEdgeColor(1,1,0.5) - # meshActor.GetProperty().EdgeVisibilityOn() boxpoints = vtk.vtkPoints() for n in range(8): diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index 326f26046..d01d118cb 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -82,7 +82,7 @@ for name in filenames: [coords[i][j-1] + coords[i][j] for j in range(1,len(coords[i]))] + \ [3.0 * coords[i][-1] - coords[i][-1 - int(len(coords[i]) > 1)]]) for i in range(3)] - grid = np.array(map(len,coords),'i') + grid = np.array(list(map(len,coords)),'i') N = grid.prod() if options.mode == 'point' else (grid-1).prod() if N != len(table.data):