simplified

This commit is contained in:
Martin Diehl 2020-03-17 11:10:02 +01:00
parent f46d79ec87
commit b65c3959f1
1 changed files with 13 additions and 14 deletions

View File

@ -185,23 +185,22 @@ for name in filenames:
if options.weights: if options.weights:
weights = [np.random.uniform(low = 0, high = options.max, size = options.N)] if options.max > 0.0 \ weights = [np.random.uniform(low = 0, high = options.max, size = options.N)] if options.max > 0.0 \
else [np.random.normal(loc = options.mean, scale = options.sigma, size = options.N)] else [np.random.normal(loc = options.mean, scale = options.sigma, size = options.N)]
else:
weights = []
seeds = np.transpose(np.vstack(tuple([seeds, data = np.transpose(np.vstack(tuple([seeds,
grainEuler, grainEuler,
np.arange(options.microstructure, np.arange(options.microstructure,options.microstructure + options.N),
options.microstructure + options.N), ] + (weights if options.weights else [])
] + weights
))) )))
# ------------------------------------------ assemble header --------------------------------------- comments = [scriptID + ' ' + ' '.join(sys.argv[1:]),
'grid\ta {}\tb {}\tc {}'.format(*options.grid),
'randomSeed\t{}'.format(options.randomSeed),
]
# ------------------------------------------ assemble header ---------------------------------------
table.info_clear() table.info_clear()
table.info_append([ table.info_append(comments)
scriptID + ' ' + ' '.join(sys.argv[1:]),
"grid\ta {}\tb {}\tc {}".format(*options.grid),
"randomSeed\t{}".format(options.randomSeed),
])
table.labels_clear() table.labels_clear()
table.labels_append( ['{dim}_{label}'.format(dim = 1+k,label = 'pos') for k in range(3)] + table.labels_append( ['{dim}_{label}'.format(dim = 1+k,label = 'pos') for k in range(3)] +
['{dim}_{label}'.format(dim = 1+k,label = 'euler') for k in range(3)] + ['{dim}_{label}'.format(dim = 1+k,label = 'euler') for k in range(3)] +
@ -212,7 +211,7 @@ for name in filenames:
# --- write seeds information ------------------------------------------------------------ # --- write seeds information ------------------------------------------------------------
table.data = seeds table.data = data
table.data_writeArray() table.data_writeArray()
# --- output finalization -------------------------------------------------------------------------- # --- output finalization --------------------------------------------------------------------------