clevar.geometry module¶
- clevar.geometry.convert_units(dist1, unit1, unit2, redshift=None, cosmo=None)[source]¶
Convenience wrapper to convert between a combination of angular and physical units.
Supported units: radians, degrees, arcmin, arcsec, Mpc, kpc, pc (letter case independent)
To convert between angular and physical units you must provide both a redshift and a cosmology object.
- Parameters
dist1 (array_like) – Input distances
unit1 (str) – Unit for the input distances
unit2 (str) – Unit for the output distances
redshift (float) – Redshift used to convert between angular and physical units
cosmo (astropy.cosmology) – Astropy cosmology object to compute angular diameter distance to convert between physical and angular units
- Returns
dist2 – Input distances converted to unit2
- Return type
array_like