simplified column parsing
This commit is contained in:
parent
4bd44f8e43
commit
f363d81de5
|
@ -97,19 +97,14 @@ for name in filenames:
|
||||||
labels = options.label != None) # no labels when taking 2D dataset
|
labels = options.label != None) # no labels when taking 2D dataset
|
||||||
table.head_read() # read ASCII header info
|
table.head_read() # read ASCII header info
|
||||||
|
|
||||||
# --------------- figure out column to process -----------------------------------------------------
|
# ------------------------------------------ process data ------------------------------------------
|
||||||
|
|
||||||
column = table.labels_index([options.label])
|
missing_labels = table.data_readArray(options.label)
|
||||||
|
if len(missing_labels) > 0:
|
||||||
if np.any(np.array(column) == -1):
|
|
||||||
file['croak'].write('column %s not found...\n'%options.label)
|
file['croak'].write('column %s not found...\n'%options.label)
|
||||||
table.close(dismiss = True) # close ASCIItable and remove empty file
|
table.close(dismiss = True) # close ASCIItable and remove empty file
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# ------------------------------------------ process data ------------------------------------------
|
|
||||||
|
|
||||||
table.data_readArray(column)
|
|
||||||
|
|
||||||
# convert data to values between 0 and 1 and arrange according to given options
|
# 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.dimension != []: table.data = table.data.reshape(options.dimension[1],options.dimension[0])
|
||||||
if options.abs: table.data = np.abs(table.data)
|
if options.abs: table.data = np.abs(table.data)
|
||||||
|
|
Loading…
Reference in New Issue