I am trying to do calculations to find the subhalo velocity dispersion and check it with the SubhaloVelDisp field, however, the values I get do not match the SubhaloVelDisp values. Specifically, how is the SubhaloVelDisp field being calculated?
Thanks!
Dylan Nelson
6 Jul '20
Hi Blaise,
There are some subtleties of the units, etc, it is computed as (where the num loop is over the member particles):
GRAVITY_NEAREST_X is the usual periodic distance function, e.g.
if x > BoxHalf:
return x-BoxSize
else:
if x < -BoxHalf:
return x+BoxSize
else:
return x
vel_to_phys is whatever you need to get that quantity into km/s, e.g. likely 1/a.
H_of_a is the usual H(z) = H0 * sqrt(Ωm(1+z)^3 + ΩΛ + Ωk(1+z)^2).
Blaise Veres
13 Jul '20
Also, for the P[p].Mass above, I figure that the Mass is a list of the masses of each particle in num. I am trying to recreate that whole code in Python, but I am not sure what mass value I would use in replace of P[p].Mass. Do you know what value/field I should use for trying to recreate that code? Thanks.
Dylan Nelson
13 Jul '20
It should just be the Masses particle field of the stars.
Hello,
I am trying to do calculations to find the subhalo velocity dispersion and check it with the SubhaloVelDisp field, however, the values I get do not match the SubhaloVelDisp values. Specifically, how is the SubhaloVelDisp field being calculated?
Thanks!
Hi Blaise,
There are some subtleties of the units, etc, it is computed as (where the
num
loop is over the member particles):Hi Dylan,
Thanks for your response. In the code you sent above, do you know how the
GRAVITY_NEAREST_X
,vel_to_phys
, andH_of_a
are defined?Hello,
GRAVITY_NEAREST_X
is the usual periodic distance function, e.g.vel_to_phys
is whatever you need to get that quantity intokm/s
, e.g. likely1/a
.H_of_a
is the usualH(z) = H0 * sqrt(Ωm(1+z)^3 + ΩΛ + Ωk(1+z)^2)
.Also, for the
P[p].Mass
above, I figure that theMass
is a list of the masses of each particle innum
. I am trying to recreate that whole code in Python, but I am not sure what mass value I would use in replace ofP[p].Mass
. Do you know what value/field I should use for trying to recreate that code? Thanks.It should just be the
Masses
particle field of the stars.