convertColonDelimitersToHMSDMS

Return to directory of Todd's CASA extensions

Converts HH:MM:SS.SSS, +DD:MM:SS.SSS to HHhMMmSS.SSSs,+DDdMMmSS.SSSs

Usage:

au.convertColonDelimitersToHMSDMS(mystring, s=True, usePeriodsForDeclination=False)
Inputs:
  • mystring: can be either a single coordinate (i.e. an RA) or a coordinate pair separated by comma or space (RA Dec)
  • s: whether or not to include the trailing 's' in both axes

Examples:

CASA <2>: au.convertColonDelimitersToHMSDMS('01:15:34.369162, +07:17:41.73011')
  Out[2]: '01h15m34.369162s, +07d17m41.73011s'                                 

CASA <3>: au.convertColonDelimitersToHMSDMS('01:15:34.369162, +07:17:41.73011',s=False)
  Out[3]: '01h15m34.369162, +07d17m41.73011'                                           

CASA <4>: au.convertColonDelimitersToHMSDMS('01:15:34.369162 +07:17:41.73011',s=False)
  Out[4]: '01h15m34.369162 +07d17m41.73011'                                           

CASA <5>: au.convertColonDelimitersToHMSDMS('01:15:34.369162 +07:17:41.73011')
  Out[5]: '01h15m34.369162s +07d17m41.73011s'      

CASA <18>: au.convertColonDelimitersToHMSDMS('01:15:34.369162, +07:17:41.73011', usePeriodsForDeclination=True)
  Out[18]: '01h15m34.369162s, +07.17.41.73011'

-- ToddHunter - 2015-07-19
Topic revision: r2 - 2015-12-08, 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