zsh2270365028的个人博客分享 http://blog.sciencenet.cn/u/zsh2270365028

博文

[转载]skycoord-python

已有 1748 次阅读 2020-11-22 22:17 |个人分类:Python|系统分类:科研笔记|文章来源:转载

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 SkyCoordclass. 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)>





https://wap.sciencenet.cn/blog-587102-1259467.html

上一篇:python设置colorbar刻度字体大小
下一篇:topcat 数学运算
收藏 IP: 119.78.226.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-29 23:13

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部