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

博文

利用Dustmaps进行消光的提取

已有 1748 次阅读 2022-8-12 20:37 |系统分类:科研笔记

1,打开终端,输入python3,进入python的终端,依次输入以下命令:

python3
Python 3.6.8 (default, Oct 14 2021, 12:20:35)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dustmaps.bayestar import BayestarQuery
>>> from astropy import units as u
>>> from astropy.coordinates import SkyCoord
>>> bay = BayestarQuery()
Loading pixel_info ...
Loading samples ...
Loading best_fit ...
Replacing NaNs in reliable distance estimates ...
Sorting pixel_info ...
Extracting hp_idx_sorted and data_idx at each nside ...
  nside = 64
  nside = 128
  nside = 256
  nside = 512
  nside = 1024
t = 141.920 s
  pix_info:   0.542 s
   samples:  88.164 s
      best:  40.438 s
       nan:   7.362 s
      sort:   4.629 s
       idx:   0.785 s
 >>> c=SkyCoord('08h22m37.42s','+03d04m41.8s',frame = 'icrs')
>>> print(bay(c))
[0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.   0.
 0.   0.   0.   0.   0.   0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.02 0.02
 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.03 0.03 0.03 0.03 0.03
 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03
 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03
 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03
 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03
 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03
 0.03 0.03 0.03 0.03 0.03 0.03 0.03 0.03]

依次输入如上的命令,会出现相应的结果,其中修改c里面的坐标,即可得到相应的消光值,亦可参考网页:

https://github.com/gregreen/dustmaps



https://blog.sciencenet.cn/blog-807279-1350967.html

上一篇:如何从图片中提取数据?
下一篇:如何将HJD 转化为 BJD时间?
收藏 IP: 117.32.155.*| 热度|

0

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

数据加载中...

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

GMT+8, 2024-4-25 17:15

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部