pynbody.analysis.halo.halo_shape

Contents

pynbody.analysis.halo.halo_shape#

pynbody.analysis.halo.halo_shape(sim, N=100, rin=None, rout=None, bins='equal')[source]#

Computes the shape of a halo as a function of radius by fitting homeoidal shells.

The halo must be pre-centred, e.g. using center().

Caution is advised when assigning large number of bins and radial ranges with many particles, as the algorithm becomes very slow.

Parameters:
  • N (int) – The number of homeoidal shells to consider. Shells with few particles will take longer to fit.

  • rin (float) – The minimum radial bin in units of sim[‘pos’]. By default this is taken as rout/1000. Note that this applies to axis a, so particles within this radius may still be included within homeoidal shells.

  • rout (float) – The maximum radial bin in units of sim[‘pos’]. By default this is taken as the largest radial value in the halo particle distribution.

  • bins (str) – The spacing scheme for the homeoidal shell bins. ‘equal’ initialises radial bins with equal numbers of particles, with the exception of the final bin which will accomodate remainders. This number is not necessarily maintained during fitting. ‘log’ and ‘lin’ initialise bins with logarithmic and linear radial spacing.

Returns:

  • rbin (SimArray) – The radial bins used for the fitting.

  • ba (array) – The axial ratio b/a as a function of radius.

  • ca (array) – The axial ratio c/a as a function of radius.

  • angle (array) – The angle of the a-direction with respect to the x-axis as a function of radius.

  • Es (array) – The rotation matrices for each shell.