2019-12-22 13:34:50 +05:30
|
|
|
#!/usr/bin/env python3
|
2015-08-13 03:44:19 +05:30
|
|
|
|
2016-03-03 19:23:55 +05:30
|
|
|
import os
|
2019-12-22 13:34:50 +05:30
|
|
|
import sys
|
|
|
|
from io import StringIO
|
2015-08-13 03:44:19 +05:30
|
|
|
from optparse import OptionParser
|
2019-12-22 13:34:50 +05:30
|
|
|
|
2015-08-13 03:44:19 +05:30
|
|
|
import damask
|
|
|
|
|
2016-01-27 22:36:00 +05:30
|
|
|
scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
|
|
|
scriptID = ' '.join([scriptName,damask.version])
|
2015-08-13 03:44:19 +05:30
|
|
|
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------------------------------
|
|
|
|
# MAIN
|
|
|
|
#--------------------------------------------------------------------------------------------------
|
|
|
|
|
2016-08-11 17:18:15 +05:30
|
|
|
parser = OptionParser(option_class=damask.extendableOption, usage='%prog [angfile[s]]', description = """
|
2015-08-13 03:44:19 +05:30
|
|
|
Convert TSL/EDAX *.ang file to ASCIItable
|
|
|
|
|
|
|
|
""", version = scriptID)
|
|
|
|
|
|
|
|
(options, filenames) = parser.parse_args()
|
|
|
|
if filenames == []: filenames = [None]
|
|
|
|
|
|
|
|
for name in filenames:
|
2019-12-22 13:34:50 +05:30
|
|
|
damask.util.report(scriptName,name)
|
2015-08-13 03:44:19 +05:30
|
|
|
|
2019-12-22 13:34:50 +05:30
|
|
|
table = damask.Table.from_ang(StringIO(''.join(sys.stdin.read())) if name is None else name)
|
|
|
|
table.to_ASCII(sys.stdout if name is None else os.path.splitext(name)[0]+'.txt')
|