本文整理汇总了Python中aplpy.FITSFigure.show_circles方法的典型用法代码示例。如果您正苦于以下问题:Python FITSFigure.show_circles方法的具体用法?Python FITSFigure.show_circles怎么用?Python FITSFigure.show_circles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aplpy.FITSFigure
的用法示例。
在下文中一共展示了FITSFigure.show_circles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_exposure_image
# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_circles [as 别名]
def plot_exposure_image(filename):
"""Plot FOV image of exposure for one given energy slice"""
from astropy.io import fits
from aplpy import FITSFigure
fig = FITSFigure(filename, dimensions=(0, 1), slices=[10], figsize=(5, 5))
header = fits.getheader(filename)
fig.show_grayscale()
fig.add_colorbar()
ra, dec = header['CRVAL1'], header['CRVAL2']
# Bug: Marker doesn't show up at the center of the run
# Bug: aplpy show_circles doesn't show a circle in degress.
fig.show_markers(ra, dec)
fig.show_circles(ra, dec, 1.)
fig.tick_labels.set_xformat('dd')
fig.tick_labels.set_yformat('dd')
fig.ticks.set_xspacing(1)
fig.ticks.set_yspacing(1)
fig.colorbar.set_axis_label_text('Effective Area (cm^2)')
fig.save('exposure_image.png')
示例2: FITSFigure
# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_circles [as 别名]
import numpy as np
from aplpy import FITSFigure
import matplotlib.pyplot as pl
from matplotlib.patches import Circle
im = np.random.randn(100,100)
gc = FITSFigure(im)
gc.show_grayscale()
gc.show_circles(20, 20, 10, alpha = 0.3, edgecolor = 'y', linewidth = 10)
gc.show_circles(40,40,10, facecolor = 'y', alpha = 0.3, linewidth = 10)
gc.show_circles(60,60,10, facecolor = 'y', alpha = 0.3, edgecolor = 'none')
gc.save('aplpy_circles.png')
pl.figure(2)
pl.imshow(im, interpolation = 'nearest', origin = 1, cmap = 'gray')
circle = Circle((20,20), 10,alpha=0.3, edgecolor = 'y',facecolor = 'none', linewidth = 10)
pl.gca().add_artist(circle)
circle = Circle((40,40), 10,alpha=0.3, facecolor = 'y', linewidth = 10)
pl.gca().add_artist(circle)
circle = Circle((60,60), 10,alpha=0.3, facecolor = 'y', linewidth = 0)
pl.gca().add_artist(circle)
pl.savefig('mpl_circles.png')
import matplotlib
import aplpy
assert matplotlib.__version__ == '1.3.0'
assert aplpy.__version__ == '0.9.9'