simplified column parsing

This commit is contained in:
Philip Eisenlohr 2015-05-21 21:54:47 +00:00
parent 4bd44f8e43
commit f363d81de5
1 changed files with 3 additions and 8 deletions

View File

@ -97,19 +97,14 @@ for name in filenames:
labels = options.label != None) # no labels when taking 2D dataset
table.head_read() # read ASCII header info
# --------------- figure out column to process -----------------------------------------------------
# ------------------------------------------ process data ------------------------------------------
column = table.labels_index([options.label])
if np.any(np.array(column) == -1):
missing_labels = table.data_readArray(options.label)
if len(missing_labels) > 0:
file['croak'].write('column %s not found...\n'%options.label)
table.close(dismiss = True) # close ASCIItable and remove empty file
continue
# ------------------------------------------ process data ------------------------------------------
table.data_readArray(column)
# convert data to values between 0 and 1 and arrange according to given options
if options.dimension != []: table.data = table.data.reshape(options.dimension[1],options.dimension[0])
if options.abs: table.data = np.abs(table.data)