matscipy.electrochemistry.continuous2discrete

matscipy.electrochemistry.continuous2discrete(distribution, box=array([50, 50, 100]), count=100, n_gridpoints=nan)

Generate ‘atoms’ from continuous distribution(s).

Coordinates are distributed according to given distributions.

Per default, X and Y coordinates are drawn uniformly.

Parameters:
  • distribution (func(x) or list of func(x)) – With one function, uniform sampling applies along x and y axes, while applying ‘distribution’ along z axis. With a list of functions, applies the respective distribution function along x, y and z direction.

  • box (np.ndarray(3), optional (default: np.array([50, 50, 100]) )) – dimensions of volume to be filled with samples

  • count (int, optional (default: 100)) – number of samples to draw

  • n_gridpoints (int or (int,int,int), optional (default: np.nan)) – If specified, samples are not placed arbitrarily, but on an evenly spaced grid of this many grid points along each axis. Specify np.nan for continuous sampling, i.e. (10,np.nan,20)

Returns:

np.ndarray((sample_size,3))

Return type:

sample coordinates