From 666b438e6abd7892004ce34ba34c8c4e3a1e797e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 18 Sep 2015 16:12:27 +0000 Subject: [PATCH] using ASCII table --- processing/pre/seeds_fromDistribution.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/processing/pre/seeds_fromDistribution.py b/processing/pre/seeds_fromDistribution.py index 23720dbb3..460a80621 100755 --- a/processing/pre/seeds_fromDistribution.py +++ b/processing/pre/seeds_fromDistribution.py @@ -268,11 +268,11 @@ initialGeomVFile.write(execute('geom_fromVoronoiTessellation '+ initialGeomVFile.reset() initialGeomTable = damask.ASCIItable(initialGeomVFile,labeled=False,readonly=True) initialGeomTable.head_read() -for i in initialGeomTable.info: - if i.startswith('microstructures'): initialMicrostructures = int(i.split('\t')[1]) -if initialMicrostructures != nMicrostructures: print 'error. Microstructure count mismatch' -initialGeomTable.data_readArray() -initialData = np.bincount(initialGeomTable.data.astype(int).ravel())[1:]/points +info,devNull = initialGeomTable.head_getGeom() + +if info['microstructures'] != nMicrostructures: print 'error. Microstructure count mismatch' + +initialData = np.bincount(initialGeomTable.microstructure_read(info['grid']))/points for i in xrange(nMicrostructures): initialHist = np.histogram(initialData,bins=target[i]['bins'])[0] target[i]['error']=np.sqrt(np.square(np.array(target[i]['histogram']-initialHist)).sum()) @@ -288,7 +288,7 @@ for i in xrange(nMicrostructures): if options.maxseeds < 1: - maxSeeds = initialMicrostructures + maxSeeds = info['microstructures'] else: maxSeeds = options.maxseeds