energies

clustertools.analysis.functions.energies(cluster, specific=True, ids=None, projected=False, softening=0.0, full=True, parallel=False, **kwargs)[source]

Calculate kinetic and potential energy of every star Parameters ———- cluster : class

StarCluster instance

specificbool

find specific energies (default: True)

ids: bool or int

if given, find the energues of a subset of stars defined either by an array of star ids, or a boolean array that can be used to slice the cluster. (default: None)

projectedbool

use projected values (default: False)

softeningfloat

Plummer softening length in cluster.units (default: 0.0)

fullbool

calculate distance of full array of stars at once with numbra (default: True)

parallelbool

calculate distances in parallel (default: False)

Returns

kin,potfloat

kinetic and potential energy of every star if the i_d argument is not used. If i_d argument is used, return an arrays with potential and kinetic energy in the same shape of i_d

History

2019 - Written - Webb (UofT) 2022 - Updated with support for multiple ids or an idexing array - Erik Gillis (UofT)