snapcenters estimates the center of a snapshot (following the discussion in Power et al. (2003)) using an iterative technique in which the center of mass of particles within a shrinking sphere is computed recursively until a convergence criterion is met. At each step of the iteration, the center of the sphere is reset to the last computed barycentre and the radius of the sphere is reduced by 2.5 per cent. The iteration is stopped when a specified number of particles (typically either 1000 particles or 1 per cent of the particles within the high-resolution region, whichever is smaller) is reached within the sphere.
Halo centers identified with this procedure are quite independent of the parameters chosen to initiate the iteration, provided that the initial sphere is large enough to encompass a large fraction of the system. In a multi-component system, such as a dark halo with substructure, this procedure isolates the densest region within the largest subcomponent. In more regular systems, the centre so obtained is in good agreement with centres obtained by weighing the centre of mass by the local density or gravitational potential of each particle. We have explicitly checked that none of the results presented here are biased by our particular choice of centering procedure. end-quote.
For snapcenters an additional weight-factor can be applied to each particle. See also snapcenter(1NEMO) and snapcenterp(1NEMO) for alternative approaches. In the examples of hackdens(1NEMO) a table compares the different approaches.
Convergence can be sped up by using a larger shrinking factor (the default is only 2.5%), by setting a finite tolerance on the centering (eta=), since the default is 0, or by increasing the minimum number of particles via fn=.
For each iteration the radius is shrunk, and if convergence is reached, it is reported. E.g.
% mkplummer - 2000 seed=123 | snapcenters - . report=t 2 19 3.77354 1940 -0.005382 0.028057 0.020065
Printed are: convergence reason, #iters, rmax, nleft, xcenter, ycenter,
zcenter
convergence reason:
0 - unexpected convergence (should never occur)
1 - eta was reached. By setting eta=0 [the default] this should never
happen
2 - iteration max was reached
3 - nmin was reached (the goal of Power2003)
4 - number in shrinking sphere hasn’t changed (not tested for, should
rarely occur)
$ mkplummer - 10000 | snapshift - - 5,0,0 | snapcenters - . report=t shrink=0.3 fn=0.1 rmax=20
Power et al (2003) - 2003MNRAS.338...14P - shrinking sphere method, S2.5
Teuben
16-may-2025 0.1 Drafted PJT 19-may-2025 0.4 renamed keywords to shrink= and fn= PJT