barak.coord.s2dec¶
- barak.coord.s2dec(ra, dec)[source]¶
Convert sexigesimal ra and dec strings (or list of ras and decs) to decimal degrees.
Parameters : ra, dec: str or arrays of str, shape (N,) :
The RA and Dec in ‘hour:min:s’ ‘deg:min:s’ format. Separators may be whitespace, colons, ‘h’, ‘m’, ‘s’ or ‘d’.
Returns : ra, dec: floats or arrays of floats, shape (N,) :
The RA and Dec in degrees.
Examples
>>> s2dec('02h59m00.56s', '-80d10m04.3s') (44.75233333333333, -80.16786111111112)
>>> sras = ['10:12:01.25', '10:14:06.13'] >>> sdecs =['01:01:45.65', '01:13:47.02'] >>> ra, dec = s2dec(sras, sdecs) >>> print zip(ra, dec) [(153.00520833333334, 1.0293472222222222), (153.52554166666667, 1.229727777777778)]