Derivation of z−space Distortions in Simulation Data¶
In this section of the documentation we derive a simple expression for how to apply z-space distortions to the usual comoving Cartesian coordinates of a simulation. Suppose you have a set of \(x_{\rm com}, y_{\rm com}, z_{\rm com}\) points in co-moving coordinates in a cosmological simulation. Let the redshift of the snapshot be \(z_{\rm true-redshift}\), and the peculiar velocity in the z-direction be \(v_{\rm z}\). Using the distant-observer approximation and treating the z-dimension as the line-of-sight, these notes derive the following expression for the z-coordinate in redshift-space:
The first part of the derivation is repeated from the textbook Mo, van den Bosch and White (2010), section 3.1.4 on peculiar velocities. For an observer in the cosmic rest frame at \(z_{\rm true-redshift},\) a galaxy at \(z_{\rm true-redshift}\) moving with peculiar velocity \(v_{\rm z}\) will be Doppler shifted according to \(1 + z_{\rm redshift}^{\rm pec} = \sqrt{\frac{1 + v_{\rm z}/c}{1 - v_{\rm z}/c}}.\) On Earth we are observing that galaxy from the vantage of z=0, then we have:
Provided that the peculiar velocity of the galaxy is non-relativistic (which should be true even in cluster environments), then \(z_{\rm redshift}^{\rm pec}=v_{\rm z}/c\), and we have
Now what we want to do is calculate how we should shift \(z_{\rm com}\) in accord with
To do that, we just take the difference in their comoving distances,
where
with \(H(z) \equiv H_0 E(z),\) where \(H_0 = 100h{\rm km/s/Mpc}\) is the Hubble constant and the function \(E(z)\) is implemented by the astropy.cosmology.FLRW.efunc
function.
Taking the difference gives
Since \(\delta z_{\rm redshift} = \frac{v_{\rm z}}{c}(1+z_{\rm redshift}^{\rm true})\) is typically a very small interval for peculiar velocities relevant to galaxies at observable redshifts, then due to the smoothness of the Hubble rate \(E(z)\) we can approximate the above integral by treating \(E(z)\) as a constant-valued \(E(z_{\rm redshift})\):
Now that we have seen the analytical derivation, let’s see how this maps onto Halotools source code. The line of code in the apply_zspace_distortion
function implementing this behavior appears as follows:
pos_err = peculiar_velocity/100./cosmology.efunc(redshift)/scale_factor
The pos_err
variable stores the value of \(\delta D_{\rm com}\), and 1/scale_factor
is equal to \(1+z_{\rm redshift}^{\rm true}\). The cosmology.efunc(redshift)
variable stores the astropy.cosmology.FLRW.efunc
implementation of \(E(z).\) Since Halotools adopts the convention that \(h=1,\) then \(H(z_{\rm redshift}^{\rm true}) = 100hE(z) = 100E(z).\)
The return_xyz_formatted_array
function implements the result of the same expression stored in the spatial_distortion
variable.