polishing vtk2ang.py
This commit is contained in:
parent
e6f1b17149
commit
4bf3b92609
|
@ -18,47 +18,43 @@ scriptID = ' '.join([scriptName,damask.version])
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
def getHeader(filename,sizeFastIndex,sizeSlowIndex,stepsize):
|
def getHeader(filename,sizeFastIndex,sizeSlowIndex,stepsize):
|
||||||
"""Returns header for ang file step size in micrometer."""
|
"""Returns header for ang file step size in micrometer."""
|
||||||
return '\n'.join([ \
|
return '\n'.join([
|
||||||
'# TEM_PIXperUM 1.000000', \
|
'# TEM_PIXperUM 1.000000',
|
||||||
'# x-star 1.000000', \
|
'# x-star 1.000000',
|
||||||
'# y-star 1.000000', \
|
'# y-star 1.000000',
|
||||||
'# z-star 1.000000', \
|
'# z-star 1.000000',
|
||||||
'# WorkingDistance 18.000000', \
|
'# WorkingDistance 18.000000',
|
||||||
'#', \
|
'#',
|
||||||
'# Phase 1', \
|
'# Phase 1',
|
||||||
'# MaterialName XX', \
|
'# MaterialName XX',
|
||||||
'# Formula XX', \
|
'# Formula XX',
|
||||||
'# Info', \
|
'# Info',
|
||||||
'# Symmetry 43', \
|
'# Symmetry 43',
|
||||||
'# LatticeConstants 2.870 2.870 2.870 90.000 90.000 90.000', \
|
'# LatticeConstants 2.870 2.870 2.870 90.000 90.000 90.000',
|
||||||
'# NumberFamilies 1', \
|
'# NumberFamilies 1',
|
||||||
'# hklFamilies 1 1 0 1 0.000000 1', \
|
'# hklFamilies 1 1 0 1 0.000000 1',
|
||||||
'# Categories 0 0 0 0 0 ', \
|
'# Categories 0 0 0 0 0 ',
|
||||||
'#', \
|
'#',
|
||||||
'# GRID: SqrGrid', \
|
'# GRID: SqrGrid',
|
||||||
'# XSTEP: ' + str(stepsize*1e6), \
|
'# XSTEP: ' + str(stepsize*1e6),
|
||||||
'# YSTEP: ' + str(stepsize*1e6), \
|
'# YSTEP: ' + str(stepsize*1e6),
|
||||||
'# NCOLS_ODD: ' + str(sizeFastIndex), \
|
'# NCOLS_ODD: ' + str(sizeFastIndex),
|
||||||
'# NCOLS_EVEN: ' + str(sizeFastIndex), \
|
'# NCOLS_EVEN: ' + str(sizeFastIndex),
|
||||||
'# NROWS: ' + str(sizeSlowIndex), \
|
'# NROWS: ' + str(sizeSlowIndex),
|
||||||
'#', \
|
'#',
|
||||||
'# OPERATOR: ' + string.replace('$Id$','\n','\\n'), \
|
'# OPERATOR: ' + string.replace('$Id$','\n','\\n'),
|
||||||
'#', \
|
'#',
|
||||||
'# SAMPLEID: %s'%filename, \
|
'# SAMPLEID: {}'.format(filename),
|
||||||
'#', \
|
'#',
|
||||||
'# SCANID: ', \
|
'# SCANID: ',
|
||||||
'#', \
|
'#',
|
||||||
]) + '\n'
|
]) + '\n'
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
def positiveRadians(angle):
|
def positiveRadians(angle):
|
||||||
"""Returns positive angle in radians from angle in degrees."""
|
"""Returns positive angle in radians from angle in degrees."""
|
||||||
angle = math.radians(float(angle))
|
return math.radians(float(angle)) % (2.*math.pi)
|
||||||
while angle < 0.0:
|
|
||||||
angle += 2.0 * math.pi
|
|
||||||
|
|
||||||
return angle
|
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|
Loading…
Reference in New Issue