LoginSignup
2
0

More than 3 years have passed since last update.

HR図をastroqueryを用いて簡単にプロットする方法

Last updated at Posted at 2020-10-11

HR図とastroquery

ヘルツシュプルング・ラッセル図(通称HR図)を astroquery という宇宙天文のデータベースを用いてプロットする手法を用いて簡単にプロットを紹介する。苦手意識がある人もとりあえずプロットしてみる親しみが沸くこともあるだろう。

コードだけあればOKな人は、google Colab のページを参照されたい。

astroquery の install

pip install astroquery

で、astroquery を入れる。

astroquery を用いてデータを取得

データはVizierというデータベースから、

にあるヒッパルコス衛星のデータを使う。

from astroquery.vizier import Vizier
v = Vizier(catalog="I/239/hip_main",columns=['HIP',"Vmag","B-V","Plx"],row_limit=-1)
data = v.query_constraints()
vmag = data[0]["Vmag"]
bv = data[0]["B-V"]
plx = data[0]["Plx"]

必要なのは、3つだけ。

  • Vmag : Vバンドの輝度
  • BV : BバンドとVバンドの明るさの比 (B-Vと書くが等級はログなので比であることに注意。)
  • plx : 年周視差。単に距離の情報が必要なだけ。近傍の星は三角測量で距離を測定しているので、annual parallax から距離に変換する。

である。

オプションの意味は、catalog="I/239/hip_main" でカタログを指定して、columns=['HIP',"Vmag","B-V","Plx"] でコラムを指定して、row_limit=-1 で上限を外してデータを全部取得する。

HR図を作成

年周視差が、20 ~ 25 mili arcsec (つまり、距離で 40-50 pc 程度)の星についてプロットしてみる。

def to_parsec(marcsec):
    return 1./(1e-3*marcsec)  # pc
pmin=20 # m arcsec
pmax=25 # m arcsec
dmax = to_parsec(pmin)
dmin = to_parsec(pmax)
dlabel = str("%3.1f" % dmin) + " pc to " + str("%3.1f" % dmax) + " pc"
print (dlabel) 
vmag_cut = vmag[ (plx > pmin) & (plx < pmax)]
bv_cut = bv [ (plx > pmin) & (plx < pmax)]

from matplotlib import pyplot as plt
plt.title(dlabel)
plt.xlim(-0.1,2)
plt.ylim(-13,0)
plt.xlabel("B-V")
plt.ylabel("Vmag")
plt.scatter(bv_cut, -vmag_cut, s=1)

とすると、

スクリーンショット 2020-10-11 17.11.33.png

このようにHR図がかける。
距離でカットをしないとどうなるか?はぜひ試してみてください。B-V は、


B-V \equiv log(Bバンドの明るさ)-log(Vバンドの明るさ) = log(Bバンドの明るさ/Vバンドの明るさ)

の意味なので、明るさの比であることにくれぐれ注意しよう。

関連ページ

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0