get_velocities_old

cosmic.sample.cmc.elson.get_velocities_old(r, r_max_cluster, gamma)[source]

Uses the spherical Jeans functions to sample the velocity dispersion for the cluster at different radii, then draws a random, isotropic velocity for each star

NOTE: this gives you correct velocity dispersion and produces a cluster in virial equilibrium, but it’s not strictly speaking correct (the distribution should have some kurtosis, in addition to getting the variance of the Gaussian correct). You can see the disagreement in the tail of the distributions when sampling a Plummer sphere. This is what mcluster does…

Use the new get_velocities function, which generates a distribution function directly from rho and samples velocities from it

This is kept around because it’s super useful to sample from when the rejection sampling gets too slow at the last X samples (e.g. gamma ~ 10)

returns (vr,vt) with same length as r