dsigma.helpers module¶
Convenience functions for the dsigma pipeline.
- dsigma.helpers.in_degrees(angle)[source]¶
Add a degree unit to an angle if it doesn’t have a unit, yet.
- Parameters:
- angle
astropy.units.quantity.Quantity Angle with or without units.
- angle
- Returns:
- angle
astropy.units.quantity.Quantity Angle with units.
- angle
- 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
- dsigma.helpers.spherical_to_cartesian(ra, dec)[source]¶
Convert spherical coordinates to Cartesian coordinates on a unit sphere.
- Parameters:
- ra
astropy.units.quantity.Quantity Right ascension.
- dec
astropy.units.quantity.Quantity Declination.
- ra
- Returns:
- x, y, z
floatornumpy.ndarray Cartesian coordinates.
- x, y, z