distrib_uni_ball
- erwans3.utils.distrib_uni_ball(npoint: int, r: Union[int, float, Quantity, ndarray] = 1, representation: Optional[Any] = None) Any
Generate random points uniformly distributed within a ball.
Generate a list of npoint points that has a uniform distribution inside a ball of radius r. The output format can be selected with representation
- Parameters:
npoint (
int) – Number of points to generate.r (
intorfloatorQuantityorndarray, optional) – Radius of the ball. Default is 1.representation (Any, optional) – Representation type for the generated points (CartesianRepresentation, SkyCoord, np.ndarray, u.Quantity). If None, returns the points as a numpy array. Default is None.
- Returns:
Random points in the specified representation type.
- Return type:
Any