• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
伊瑟拉爱吃鱼
博客园    首页    新随笔    联系   管理    订阅  订阅
绘制Finding Chart的方法

在针对少数特定源的测光项目时,有时会需要绘制源的Finding Chart图,我们一般使用aplpy。首先找一张fits图像到http://nova.astrometry.net/upload做定标,获取WCS。

import aplpy

gc = aplpy.FITSFigure('fits_filename')
gc.show_grayscale(invert=True) # 使用invert是白底,False为黑底

# 需要使用颜色时
gc.show_colorscale(cmap='***')

# 比较简单的标注target和ref时使用pyplot即可,坐标使用pixel坐标
plt.scatter(x,y,c='',edgecolor='cyan',s=30)

当然,aplpy包自身也带了一些标记和zoom手段:

# 将图像以目标源为中心进行缩放,需要注意三个参数都是以度为单位的
gc.recenter(x, y, radius)

# 标记target及ref等,coords_frame是可选参数,world or pixel,选择world坐标时前三个参数单位都为度
gc.show_circles(x, y, radius, coords_frame, color)

# 添加文字注释,relative用来标注是否使用WCS或是其他坐标
gc.add_label(x,y,text,size,relative)

# 添加colorbar
gc.add_colorbar()

# 设置坐标ticks
gc.set_xaxis_coord_type('scalar':标量坐标,‘longitude’ or ‘latitude’:角度坐标)

# 保存,dpi设置太高比较慢
gc.save(filename,dpi,format='eps' or 'png' or ...)

 

参考链接:https://aplpy.readthedocs.io/en/stable/fitsfigure/quickstart.html

posted on 2020-07-26 16:36  伊瑟拉爱吃鱼  阅读(103)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3