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