dsigma.helpers module¶
Convenience functions for the dsigma pipeline.
- dsigma.helpers.cartesian_to_spherical(x, y, z)[source]¶
Convert cartesian coordinates to spherical coordinates.
- Parameters:
- x
floatornumpy.ndarray x-coordinate.
- y
floatornumpy.ndarray y-coordinate.
- z
floatornumpy.ndarray z-coordinate.
- x
- Returns:
- ra, dec
floatornumpy.ndarray Spherical coordinates.
- ra, dec
- dsigma.helpers.interpolate_over_redshift(f, z, *args, **kwargs)[source]¶
Interpolate a function over redshift.
For many cosmological calculations such as comoving distances performing the precise calculation for all objects in the catalog would be very expensive. Instead, we can perform the calculation on a grid in redshift and then interpolate. For most calculations, this is extremely accurate and much faster.
- Parameters:
- f
callable() Function to evaluate over redshift.
- z
numpy.ndarray Redshifts to evaluate.
- *args
Additional arguments passed to f.
- **kwargs
Extra keyword arguments passed to f.
- f
- Returns:
- f_of_z
numpy.ndarrayorastropy.units.quantity.Quantity Interpolated values.
- f_of_z
- Raises:
ValueErrorIf redshifts are negative.
- dsigma.helpers.spherical_to_cartesian(ra, dec)[source]¶
Convert spherical coordinates to cartesian coordinates on a unit sphere.
- Parameters:
- ra
floatornumpy.ndarray Right ascension.
- dec
floatornumpy.ndarray Declination.
- ra
- Returns:
- x, y, z
floatornumpy.ndarray Cartesian coordinates.
- x, y, z