|
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
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-22 01:21
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社