only grain file type 1 seems to make sense (type 2 has average values).

For type one, data is fixed i.e. flexible labels are not useful
This commit is contained in:
Martin Diehl 2016-10-06 15:22:05 +02:00
parent fb8a464674
commit 5951b45259
1 changed files with 3 additions and 13 deletions

View File

@ -13,23 +13,13 @@ scriptID = ' '.join([scriptName,damask.version])
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
parser = OptionParser(option_class=damask.extendableOption, usage='%prog [file[s]]', description = """ parser = OptionParser(option_class=damask.extendableOption, usage='%prog [file[s]]', description = """
Adds header to OIM grain file to make it accesible as ASCII table Adds header to OIM grain file type 1 to make it accesible as ASCII table
""", version = scriptID) """, version = scriptID)
defaults = {'labels':['1_euler','2_euler','3_euler','1_pos','2_pos','IQ','CI','Fit','GrainID']}
parser.add_option('-l', '--labels',
dest = 'labels',
action = 'extend', metavar = '<string LIST>',
help = 'lables of requested columns [{}]'.format(defaults['labels']))
(options, filenames) = parser.parse_args() (options, filenames) = parser.parse_args()
if options.labels is None:
options.labels = defaults['labels']
# --- loop over input files ------------------------------------------------------------------------- # --- loop over input files -------------------------------------------------------------------------
if filenames == []: filenames = [None] if filenames == []: filenames = [None]
@ -44,10 +34,10 @@ for name in filenames:
table.head_read() table.head_read()
data = [] data = []
while table.data_read(): while table.data_read():
data.append(table.data[0:len(options.labels)]) data.append(table.data[0:9])
table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:]))
table.labels_append(options.labels) table.labels_append(['1_euler','2_euler','3_euler','1_pos','2_pos','IQ','CI','Fit','GrainID'])
table.head_write() table.head_write()
for i in data: for i in data:
table.data = i table.data = i