def draw_rand_pos(self, radius, z_min, z_max,<EOL>min_r=np.array([<NUM_LIT:0>]), min_cell_interdist=<NUM_LIT>, **args):
x = (np.random.rand(self.POPULATION_SIZE)-<NUM_LIT:0.5>)*radius*<NUM_LIT:2><EOL>y = (np.random.rand(self.POPULATION_SIZE)-<NUM_LIT:0.5>)*radius*<NUM_LIT:2><EOL>z = np.random.rand(self.POPULATION_SIZE)*(z_max - z_min) + z_min<EOL>min_r_z = {}<EOL>min_r = np.array(min_r)<EOL>if min_r.size > <NUM_LIT:0>:<EOL><INDENT>if type(min_r) == type(np.array([])):<EOL><INDENT>j = <NUM_LIT:0><EOL>for j in range(min_r.shape[<NUM_LIT:0>]):<EOL><INDENT>min_r_z[j] = np.interp(z, min_r[<NUM_LIT:0>,], min_r[<NUM_LIT:1>,])<EOL>if j > <NUM_LIT:0>:<EOL><INDENT>[w] = np.where(min_r_z[j] < min_r_z[j-<NUM_LIT:1>])<EOL>min_r_z[j][w] = min_r_z[j-<NUM_LIT:1>][w]<EOL><DEDENT><DEDENT>minrz = min_r_z[j]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>minrz = np.interp(z, min_r[<NUM_LIT:0>], min_r[<NUM_LIT:1>])<EOL><DEDENT>R_z = np.sqrt(x**<NUM_LIT:2> + y**<NUM_LIT:2>)<EOL>cell_interdist = self.calc_min_cell_interdist(x, y, z)<EOL>[u] = np.where(np.logical_or((R_z < minrz) != (R_z > radius),<EOL>cell_interdist < min_cell_interdist))<EOL>while len(u) > <NUM_LIT:0>:<EOL><INDENT>for i in range(len(u)):<EOL><INDENT>x[u[i]] = (np.random.rand()-<NUM_LIT:0.5>)*radius*<NUM_LIT:2><EOL>y[u[i]] = (np.random.rand()-<NUM_LIT:0.5>)*radius*<NUM_LIT:2><EOL>z[u[i]] = np.random.rand()*(z_max - z_min) + z_min<EOL>if type(min_r) == type(()):<EOL><INDENT>for j in range(np.shape(min_r)[<NUM_LIT:0>]):<EOL><INDENT>min_r_z[j][u[i]] =np.interp(z[u[i]], min_r[<NUM_LIT:0>,], min_r[<NUM_LIT:1>,])<EOL>if j > <NUM_LIT:0>:<EOL><INDENT>[w] = np.where(min_r_z[j] < min_r_z[j-<NUM_LIT:1>])<EOL>min_r_z[j][w] = min_r_z[j-<NUM_LIT:1>][w]<EOL><DEDENT>minrz = min_r_z[j]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>minrz[u[i]] = np.interp(z[u[i]], min_r[<NUM_LIT:0>,], min_r[<NUM_LIT:1>,])<EOL><DEDENT><DEDENT>R_z = np.sqrt(x**<NUM_LIT:2> + y**<NUM_LIT:2>)<EOL>cell_interdist = self.calc_min_cell_interdist(x, y, z)<EOL>[u] = np.where(np.logical_or((R_z < minrz) != (R_z > radius),<EOL>cell_interdist < min_cell_interdist))<EOL><DEDENT>soma_pos = []<EOL>for i in range(self.POPULATION_SIZE):<EOL><INDENT>soma_pos.append({'<STR_LIT>' : x[i], '<STR_LIT>' : y[i], '<STR_LIT>' : z[i]})<EOL><DEDENT>return soma_pos<EOL>
Draw some random location within radius, z_min, z_max,
and constrained by min_r and the minimum cell interdistance.
Returned argument is a list of dicts [{'xpos', 'ypos', 'zpos'},].


Parameters
----------
radius : float
    Radius of population.
z_min : float
    Lower z-boundary of population.
z_max : float
    Upper z-boundary of population.
min_r : numpy.ndarray
    Minimum distance to center axis as function of z.
min_cell_interdist : float
    Minimum cell to cell interdistance.
**args : keyword arguments
    Additional inputs that is being ignored.


Returns
-------
soma_pos : list
    List of dicts of len population size
    where dict have keys xpos, ypos, zpos specifying
    xyz-coordinates of cell at list entry `i`.


See also
--------
PopulationSuper.calc_min_cell_interdist