elementwise_norm

halotools.utils.elementwise_norm(x)[source] [edit on github]

Calculate the normalization of each element in a list of 3d points.

Parameters:

x : ndarray

Numpy array of shape (npts, 3) storing a collection of 3d points

Returns:

result : ndarray

Numpy array of shape (npts, ) storing the norm of each 3d point in x.

Examples

>>> npts = int(1e3)
>>> x = np.random.random((npts, 3))
>>> norms = elementwise_norm(x)