How to use the plonk.analysis.particles.angular_momentum function in plonk

To help you get started, we’ve selected a few plonk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmentipl / plonk / plonk / analysis / total.py View on Github external
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)
github dmentipl / plonk / plonk / snap / extra.py View on Github external
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)