0 votes
2.8k views
by datalab (20.7k points) | 2.8k 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
by robnik (1.0k points)

418 questions

434 answers

440 comments

637 users

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

Categories