py21cmfast.rsds =============== .. py:module:: py21cmfast.rsds .. autoapi-nested-parse:: Module for accounting redshift space distortions. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: py21cmfast.rsds.apply_rsds py21cmfast.rsds.estimate_rsd_displacements py21cmfast.rsds.include_dvdr_in_tau21 py21cmfast.rsds.rsds_shift Module Contents --------------- .. py:function:: apply_rsds(field, los_velocity, redshifts, inputs, periodic, n_rsd_subcells = 4) Apply redshift-space distortions to a field. .. rubric:: Notes To ensure that we cover all the slices in the field after the velocities have been applied, we extrapolate the densities and velocities on either end by the maximum velocity offset in the field. Then, to ensure we don't pick up cells with zero particles (after displacement), we interpolate the slices onto a finer regular grid (in comoving distance) and then displace the field on that grid, before interpolating back onto the original slices. :Parameters: * **field** -- A box of the field on which redshift-space distortions shall be applied. * **los_velocity** -- Line-of-sight velocities for each cell of brightness_temp, in Mpc/second. * **redshifts** -- An array of the redshifts along the los. Can also be a float (could be useful for coeval boxes) * **inputs** -- The input parameters corresponding to the box. * **periodic** (*bool*) -- Whether to assume periodic boundary conditions along the line-of-sight. * **n_rsd_subcells** (*int, optional*) -- The number of subcells into which each cell is divided when redshift space distortions are applied. Default is 4. :returns: *field_with_rsds* -- A box of the field, with redshift space distortions. .. !! processed by numpydoc !! .. py:function:: estimate_rsd_displacements(classy_output, cosmo, redshifts, factor = 1.0) Estimate the rms of the redshift space distortions displacement field at given redshifts. :Parameters: * **classy_output** (*classy.Class*) -- An object containing all the information from the CLASS calculation. * **cosmo** (*astropy.cosmology*) -- The assumed cosmology * **redshifts** (*list*) -- List of the redshifts at which the rms of the displacement field is computed. * **factor** (*float, optional*) -- Factor to multiply the rms velocity from CLASS. Default is 1. :returns: **displacements** (*np.array*) -- The rms of the RSD displacement field. .. !! processed by numpydoc !! .. py:function:: include_dvdr_in_tau21(brightness_temp, los_velocity, redshifts, inputs, periodic, tau_21 = None) Include velocity gradient corrections to the brightness temperature field. :Parameters: * **brightness_temp** -- A box of the brightness temperature, without velocity gradient corrections. * **los_velocity** -- Line-of-sight velocities for each cell of brightness_temp, in Mpc/second. * **redshifts** -- An array of the redshifts along the los. Can also be a float (could be useful for coeval boxes) * **inputs** -- The input parameters corresponding to the box. * **tau_21** -- A box of the 21cm optical depth. Not required if inputs.astro_options.USE_TS_FLUCT = False. * **periodic** -- Whether to assume periodic boundary conditions along the line-of-sight. :returns: *tb_with_dvdr* -- A box of the brightness temperature, with velocity gradient corrections. .. !! processed by numpydoc !! .. py:function:: rsds_shift(field, los_displacement, n_rsd_subcells = 4, periodic = False) Shift the cells of a field according to the los displacement. :Parameters: * **field** -- A box of the field on which redshift-space distortions shall be applied, shape (nslices, ncoords). * **los_displacement** -- The line-of-sight "apparent" displacement of the field, in pixel coordinates. Equal to ``v / H(z) / cell_size``. Positive values are towards the observer, shape ``(nslices, ncoords)``. * **periodic** (*bool, optioanl*) -- Whether to assume periodic boundary conditions along the line-of-sight. * **n_rsd_subcells** (*int, optional*) -- The number of subcells into which each cell is divided when redshift space distortions are applied. Default is 4. :returns: *field_with_rsds* -- A box of the field, with redshift space distortions, shape (nslices, ncoords). .. !! processed by numpydoc !!