Closed peeples closed 2 years ago
I'm not sure if my way of calculating it would make sense for other projects, it's quite lengthy. Most of the steps are to make sure that we will have the right vectors to build the mocky way coordinate system. Let me elaborate on the steps and we can discuss what are the differences:
First I get the center of the galaxy using foggie.utils.get_halo_center
(this should be consistent among every one? )
2nd, I calculate the angular momentum (L
) for a sphere centering at halo center, with radius of R
, and R
varies from 5 kpc to 50 kpc ish. L
is calculated by setting use_gas=True, use_particles=False
, which turns out to be critical to get offaxprojection
right.
Say at radius Ri
, I get an L
. I calculate two other orthogonal vectors I call sun_vec
and phi_vec
, which are vectors in the disk plane. Using (L, sun_vec, phi_vec)
which form the galactic coordinate vector UVW later on for mocky way, I make face-on (project along L
) and edge-on (project along sun_vec
and phi_vec
) projections of NHI
from external angles. From here you can see that the choice of (Ri, L)
matters because we want a flat disk when we do edge-on projections.
Then I loops through Ri from 5 to 50 kpc to see which Ri gives me the best edge-on projection in HI, and also do an all-sky projection from halo_center to make sure that (Ri, L)
also gives me flat disk allsky projection.
Eventually I decide on a Ri
value (such that disk is flat in both edge-on and allsky projection), and calculate the bulk velocity of gas within that sphere. For DD2175
, Ri is 5 kpc, so it doesn't matter that much that I only use gas. But it probably matter more if Ri is larger and we should consider particle velocities as well.
The galaxy bulk velocity is calculated as the bulk velocity within a sphere of 10 kpc radius centered on the halo center.
Lots of ways to calculate the velocity of the galaxy or halo. We should decide on something that is reasonable for most use cases and have
get_halo_center
return it.