diff --git a/csiborgtools/fits/halo.py b/csiborgtools/fits/halo.py index 596e8ef..c79a60a 100644 --- a/csiborgtools/fits/halo.py +++ b/csiborgtools/fits/halo.py @@ -425,8 +425,7 @@ class Clump: Returns ------- - m : 1-dimensional array - Array of shape `(n_particles, )`. + m : 1-dimensional array of shape `(n_particles, )` """ return self._m @@ -437,6 +436,17 @@ class Clump: raise TypeError("`r` and `m` must be equal size 1-dim arrays.") self._m = m + @property + def center_mass(self): + """ + Clump center of mass. + + Returns + ------- + cm : 1-dimensional array + """ + return numpy.average(self.pos, axis=0, weights=self.m) + @property def index(self): """