phasing out python shell scripts
This commit is contained in:
parent
8186be6293
commit
816e86ae5f
|
@ -55,20 +55,9 @@ for name in filenames:
|
||||||
np.array([o*float(n.lower().replace('x','')) if n.lower().endswith('x') \
|
np.array([o*float(n.lower().replace('x','')) if n.lower().endswith('x') \
|
||||||
else float(n) for o,n in zip(size,options.size)],dtype=float)
|
else float(n) for o,n in zip(size,options.size)],dtype=float)
|
||||||
|
|
||||||
damask.util.croak(geom.update(microstructure =
|
geom.scale(new_grid)
|
||||||
ndimage.interpolation.zoom(
|
damask.util.croak(geom.update(microstructure = None,
|
||||||
geom.microstructure,
|
|
||||||
new_grid/grid,
|
|
||||||
output=geom.microstructure.dtype,
|
|
||||||
order=0,
|
|
||||||
mode='nearest',
|
|
||||||
prefilter=False,
|
|
||||||
) if np.any(new_grid != grid) \
|
|
||||||
else None,
|
|
||||||
size = new_size))
|
size = new_size))
|
||||||
geom.add_comments(scriptID + ' ' + ' '.join(sys.argv[1:]))
|
geom.add_comments(scriptID + ' ' + ' '.join(sys.argv[1:]))
|
||||||
|
|
||||||
if name is None:
|
geom.to_file(sys.stdout if name is None else name)
|
||||||
sys.stdout.write(str(geom.show()))
|
|
||||||
else:
|
|
||||||
geom.to_file(name)
|
|
||||||
|
|
|
@ -467,6 +467,29 @@ class Geom():
|
||||||
#self.add_comments('tbd')
|
#self.add_comments('tbd')
|
||||||
|
|
||||||
|
|
||||||
|
def scale(self,grid):
|
||||||
|
"""
|
||||||
|
Scale microstructure to new grid
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
grid : iterable of int
|
||||||
|
new grid dimension
|
||||||
|
|
||||||
|
"""
|
||||||
|
return self.update(
|
||||||
|
ndimage.interpolation.zoom(
|
||||||
|
self.microstructure,
|
||||||
|
grid/self.get_grid(),
|
||||||
|
output=self.microstructure.dtype,
|
||||||
|
order=0,
|
||||||
|
mode='nearest',
|
||||||
|
prefilter=False
|
||||||
|
)
|
||||||
|
)
|
||||||
|
#self.add_comments('tbd')
|
||||||
|
|
||||||
|
|
||||||
def clean(self,stencil=3):
|
def clean(self,stencil=3):
|
||||||
"""
|
"""
|
||||||
Smooth microstructure by selecting most frequent index within given stencil at each location.
|
Smooth microstructure by selecting most frequent index within given stencil at each location.
|
||||||
|
|
Loading…
Reference in New Issue