Ang_Distance

cosmo_utils.utils.geometry.Ang_Distance(ra1, ra2, dec1, dec2, unit='deg', method='haversine')[source] [edit on github]

Calculates angular separation between two sets of points with given right ascensions and declinations.

Taken from: https://en.wikipedia.org/wiki/Haversine_formula

Parameters:

ra1, ra2 : float

Right Ascension of the 1st and 2nd points. Units in degrees by default.

dec1, dec2 : float

Declination of the 1st and 2nd points. Units in degrees by default.

unit : {‘dec’,’rad’} str, optional

Unit of ra1, ra2, dec1, and dec2. This will also determine the final unit that outputs this function.

method : {‘haversine’, ‘astropy’} str, optional

Method to use in order to calculate angular separation. This variable is to by default to the haversine method. If astropy, it will use the astropy framework to determine the angular separation.

Returns:

ang_sep : float

Angular separation between 1st and 2nd point. In units of degrees.

Notes

A = 90. - dec2 B = 90. - dec1 D = ra1 - ra2 c = Angle between two points