Usage of angularSeparationOfDirections

Return to directory of Todd's CASA extensions

 Accepts two direction dictionaries and returns the separation in radians. It computes great circle angle using the Vincenty formula. See also angularSeparationOfScans, angularSeparationOfStrings, angularSeparationOfPlanets, angularSeparation, angularSeparationRadians, and angularSeparationRadiansTuples.

Usage:

au.angularSeparationOfDirections(dir1, dir2, returnComponents=False)
By default, it returns the angle in radians. If returnComponents == True, then it returns: [angle, ra_angle, dec_angle, ra_angle*cos(Dec)]

Examples:

CASA <15>: ms.open('uid___A002_X1465d3_Xc7.ms')
  Out[15]: True
CASA <16>: a=ms.getfielddirmeas(fieldid=0)
CASA <17>: b=ms.getfielddirmeas(fieldid=1)
CASA <18>: au.angularSeparationOfDirections(a,b)
{'type': 'direction', 'm1': {'value': -0.51036394872856283, 'unit': 'rad'}, 'm0': {'value': -1.20056435950273, 'unit': 'rad'}, 'refer': 'J2000'} {'type': 'direction', 'm1': {'value': 0.0, 'unit': 'rad'}, 'm0': {'value': 0.0, 'unit': 'rad'}, 'refer': 'J2000'}
  Out[18]: 1.2495785188322224

CASA <19>: au.angularSeparationOfDirections(a,b,True)
{'type': 'direction', 'm1': {'value': -0.51036394872856283, 'unit': 'rad'}, 'm0': {'value': -1.20056435950273, 'unit': 'rad'}, 'refer': 'J2000'} {'type': 'direction', 'm1': {'value': 0.0, 'unit': 'rad'}, 'm0': {'value': 0.0, 'unit': 'rad'}, 'refer': 'J2000'}
  Out[19]: array([ 1.24957852, -1.20056436, -0.51036395, -1.16168694])

-- ToddHunter - 2013-09-09
Topic revision: r1 - 2013-09-09, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback