From 5951b45259611f554a5fec1e0c3bf5381cc7bbc0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 6 Oct 2016 15:22:05 +0200 Subject: [PATCH] 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 --- processing/misc/OIMgrainFile_toTable.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/processing/misc/OIMgrainFile_toTable.py b/processing/misc/OIMgrainFile_toTable.py index a2a8c9d3b..063adb0db 100755 --- a/processing/misc/OIMgrainFile_toTable.py +++ b/processing/misc/OIMgrainFile_toTable.py @@ -13,23 +13,13 @@ scriptID = ' '.join([scriptName,damask.version]) #-------------------------------------------------------------------------------------------------- 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) -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 = '', - help = 'lables of requested columns [{}]'.format(defaults['labels'])) - (options, filenames) = parser.parse_args() -if options.labels is None: - options.labels = defaults['labels'] - # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] @@ -44,10 +34,10 @@ for name in filenames: table.head_read() data = [] 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.labels_append(options.labels) + table.labels_append(['1_euler','2_euler','3_euler','1_pos','2_pos','IQ','CI','Fit','GrainID']) table.head_write() for i in data: table.data = i