|||
refer to:
https://docs.astropy.org/en/stable/coordinates/index.html#module-astropy.coordinates
The coordinates
package provides classes for representing a variety
of celestial/spatial coordinates and their velocity components, as well as tools
for converting between common coordinate systems in a uniform way.
The best way to start using coordinates
is to use the SkyCoord
class. SkyCoord
objects are instantiated by passing in positions (and
optional velocities) with specified units and a coordinate frame. Sky positions
are commonly passed in as Quantity
objects and the frame is
specified with the string name.
>>> from astropy import units as u >>> from astropy.coordinates import SkyCoord >>> c = SkyCoord(ra=10.625*u.degree, dec=41.2*u.degree, frame='icrs')
>>> c = SkyCoord(10.625, 41.2, frame='icrs', unit='deg') >>> c = SkyCoord('00h42m30s', '+41d12m00s', frame='icrs') >>> c = SkyCoord('00h42.5m', '+41d12m') >>> c = SkyCoord('00 42 30 +41 12 00', unit=(u.hourangle, u.deg)) >>> c = SkyCoord('00:42.5 +41:12', unit=(u.hourangle, u.deg)) >>> c <SkyCoord (ICRS): (ra, dec) in deg (10.625, 41.2)>
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-27 23:39
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社