From 04cb8111c6b5440cdafa0eb5504eb532484e5197 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 22 Mar 2020 07:08:54 +0100 Subject: [PATCH] only used for non-selective --- processing/pre/seeds_fromRandom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index f8ded554a..2de513c2c 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -126,10 +126,10 @@ for name in filenames: eulers[:,1] = np.degrees(np.arccos(2*eulers[:,1]-1.0)) # cos(Phi) is uniformly distributed eulers[:,2] *= 360.0 # phi_2 is uniformly distributed - coords = damask.grid_filters.cell_coord0(grid,size).reshape(-1,3) if not options.selective: - seeds = coords[np.random.choice(coords.shape[0], options.N, replace=False)] \ + coords = damask.grid_filters.cell_coord0(grid,size).reshape(-1,3) + seeds = coords[np.random.choice(np.prod(grid), options.N, replace=False)] \ + np.broadcast_to(size/grid,(options.N,3))*(np.random.rand(options.N,3)*.5-.25) # wobble without leaving grid else: seeds = np.empty((options.N,3))