Notebook

これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。

HTML ファイル生成日時: 2024/07/21 18:37:15.562 (台灣標準時)

観測天体の visibility の確認

天文観測をする場合には、観測する対象の目標天体がどの時間帯に条件よく観 測できるのか事前に確認しておく必要がある。 airmass が小さいときに条件 よく観測できる。また、測光標準星を観測する場合には、大気減光を評価する ために airmass が小さいときも、大きいときも、観測した方がよいこともあ る。そのため、観測する予定の天体について、時間に対するairmass の変化の 図を作っておくと便利である。そのような図は Astropy の affiliated package で ある astroplan を使 うと手軽に作成することができる。

以下に、 astroplan package を使った airmass plot を作るための Python スクリプトの例を示しておく。


#!/usr/pkg/bin/python3.9

# importing numpy module
import numpy

# importing astropy module
import astropy.time
import astropy.units
import astropy.coordinates

# importing astroplan module
import astroplan
import astroplan.plots

# importing matplotlib module
import matplotlib.figure
import matplotlib.backends.backend_agg

# figure file for saving
file_fig = 'std_202102.pdf'

# units
unit_m = astropy.units.m
unit_hour = astropy.units.hour

# Lulin observatory
lulin_lon = "+120d52m25s"
lulin_lat = "+23d28m07s"
lulin_elev = 2862 * unit_m

# location object
location = astropy.coordinates.EarthLocation.from_geodetic \
    (lulin_lon, lulin_lat, lulin_elev)

# observer object
lulin = astroplan.Observer (location=location, name="Lulin", \
                            timezone="Asia/Taipei")

# date/time
time_str = "2021-02-08T16:00:00"
time     = astropy.time.Time (time_str)
time     = time + numpy.linspace (-1, +8, 100) * unit_hour

# target

coord1 = astropy.coordinates.SkyCoord(133.45491, -0.5591, frame='icrs', unit="deg")
sa100b = astroplan.FixedTarget(name='SA100B', coord=coord1)
coord2 = astropy.coordinates.SkyCoord(149.46882, -0.7934, frame='icrs', unit="deg")
sa101c = astroplan.FixedTarget(name='SA101C', coord=coord2)
coord3 = astropy.coordinates.SkyCoord(162.53305, -0.0346, frame='icrs', unit="deg")
pg1047 = astroplan.FixedTarget(name='PG1047', coord=coord3)
coord4 = astropy.coordinates.SkyCoord(202.08776, -2.3601, frame='icrs', unit="deg")
g14_15 = astroplan.FixedTarget(name='G14-15', coord=coord4)

# making objects "fig" and "ax"
fig = matplotlib.figure.Figure ()
matplotlib.backends.backend_agg.FigureCanvasAgg (fig)
ax = fig.add_subplot (111)

# plotting
box = ax.get_position ()
ax.set_position ([box.x0, box.y0, box.width * 0.83, box.height])
astroplan.plots.plot_airmass (sa100b, lulin, time, ax=ax)
astroplan.plots.plot_airmass (sa101c, lulin, time, ax=ax)
astroplan.plots.plot_airmass (pg1047, lulin, time, ax=ax)
astroplan.plots.plot_airmass (g14_15, lulin, time, ax=ax, \
                              brightness_shading=True, max_airmass=2.2)
ax.grid ()
ax.legend (bbox_to_anchor=(1.05, 1.00), loc='upper left', shadow=True)

# saving the plot into a file
fig.savefig (file_fig, bbox_inches="tight")

これを実行してみる。

% chmod 755 std_202102.py
% ./std_202102.py
% ls -l std_202102.pdf 
-rw-r--r--  1 daisuke  wheel  16728 Feb 14 15:42 std_202102.pdf

この場合、 std_202102.pdf というファイルができるので、それを表示してみ る。

% xpdf std_202102.pdf
fig_202102/std_202102.png


Frequently accessed files

  1. Computer___Python/20220518_0.html
  2. Computer___Network/20230516_00.html
  3. Computer___FreeBSD/20220621_0.html
  4. Computer___Network/20230726_00.html
  5. Food___Taiwan/20220429_0.html
  6. Computer___Python/20220715_0.html
  7. Misc___Taiwan/20240207_00.html
  8. Computer___NetBSD/20220817_3.html
  9. Computer___Network/20230508_00.html
  10. Computer___Python/20220410_0.html
  11. Computer___Debian/20210223_1.html
  12. Computer___Python/20210124_0.html
  13. Computer___NetBSD/20220818_1.html
  14. Computer___NetBSD/20220428_0.html
  15. Food___Taiwan/20230526_00.html
  16. Science___Astronomy/20220503_0.html
  17. Science___Math/20220420_0.html
  18. Computer___Python/20221013_0.html
  19. Computer___TeX/20230503_00.html
  20. Computer___NetBSD/20220808_0.html
  21. Computer___NetBSD/20230119_00.html
  22. Computer___NetBSD/20210204_0.html
  23. Computer___NetBSD/20230515_00.html
  24. Travel___Taiwan/20220809_2.html
  25. Food___Taiwan/20210205_5.html
  26. Science___Astronomy/20220420_1.html
  27. Computer___Python/20220816_1.html
  28. Computer___NetBSD/20240101_02.html
  29. Computer___Network/20240130_00.html
  30. Computer___FreeBSD/20221007_0.html


HTML file generated by Kinoshita Daisuke.