0 votes
2,733 views
asked May 28, 2017 by datalab (19,200 points) | 2,733 views

1 Answer

0 votes

You can use the functionality from astropy:

from astropy.coordinates import name_resolve
coords = name_resolve.get_icrs_coordinates('Cyg A')  # Cygnus A

Print the coordinate object:

print coords
<SkyCoord (ICRS): (ra, dec) in deg
    (299.8681525, 40.7339156)>

Or access RA and Dec directly:

print coords.ra, coords.dec
299d52m05.349s 40d44m02.0962s

In decimal format:

print coords.ra.value, coords.dec.value
299.8681525 40.7339156

You can also represent them e.g. in Galactic frame:

print coords.galactic
<SkyCoord (Galactic): (l, b) in deg
    (76.18988044, 5.75538777)>

Or as decimal values:

print coords.galactic.l.value, coords.galactic.b.value
76.1898804421 5.75538777496
answered Jun 2, 2017 by robnik (1,040 points)

359 questions

372 answers

385 comments

2,427 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.