Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Parameters
----------
snap
The Snap object.
origin : optional
The origin around which to compute the angular momentum as a
ndarray or tuple (x, y, z). Default is (0, 0, 0).
ignore_accreted : optional
Ignore accreted particles. Default is True.
Returns
-------
ndarray
The total angular momentum like (lx, ly, lz).
"""
return particles.angular_momentum(
snap=snap, origin=origin, ignore_accreted=ignore_accreted
).sum(axis=0)
def angular_momentum(snap) -> ndarray:
"""Angular momentum."""
origin = (
snap.translation if snap.translation is not None else (0.0, 0.0, 0.0)
)
return particles.angular_momentum(snap=snap, origin=origin)