当前位置: 首页>>代码示例>>Python>>正文


Python FITSFigure.show_regions方法代码示例

本文整理汇总了Python中aplpy.FITSFigure.show_regions方法的典型用法代码示例。如果您正苦于以下问题:Python FITSFigure.show_regions方法的具体用法?Python FITSFigure.show_regions怎么用?Python FITSFigure.show_regions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aplpy.FITSFigure的用法示例。


在下文中一共展示了FITSFigure.show_regions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_rgb_image

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_regions [as 别名]
import os

'''
For proposal: 2016.1.00750.S
'''

path = "/media/eric/Data_3/NGC1313/"
fits_cube = os.path.join(path, "ngc1313_noao.fits")
fits_twod = os.path.join(path, "ngc1313_noao_2d.fits")
rgb_image = os.path.join(path, "ngc1313_noao_rgb.png")

# Make RGB image if it isn't there
if not os.path.exists(rgb_image):
    make_rgb_image(fits_cube, rgb_image)

fig = FITSFigure(fits_twod)
fig.show_rgb(rgb_image)
# fig.show_grayscale(invert=True)
# ALMA regions
fig.show_regions("ngc1313_targets.reg")
# Hubble ACS field outlines
fig.show_regions(os.path.join(path, "HST/final_mosaic/coverage_outline.reg"))
fig.hide_tick_labels()
fig.hide_xaxis_label()
fig.hide_yaxis_label()

# Should be zoomed in on before saving
# fig.save(os.path.join(path, "ngc1313_noao_field_overlays.png"))

# Also needs to be re-orientated such that N is actually up-sh
开发者ID:e-koch,项目名称:ewky_scripts,代码行数:32,代码来源:ngc1313_mosaic_figure.py

示例2: FITSFigure

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_regions [as 别名]
# Halpha
halp_fig = FITSFigure(halp_proj.hdu, subplot=(2, 3, 1), figure=fig)
halp_fig.show_grayscale(stretch="log", vmin=0.01)
halp_fig.hide_xaxis_label()
halp_fig.hide_yaxis_label()
halp_fig.hide_tick_labels()
halp_fig.set_title(r"H$\alpha$")

hi_fig = FITSFigure(hi_proj.hdu, subplot=(2, 3, 2), figure=fig)
hi_fig.show_grayscale()
hi_fig.hide_xaxis_label()
hi_fig.hide_yaxis_label()
hi_fig.hide_tick_labels()
hi_fig.set_title(r"HI")
hi_fig.set_nan_color("k")
hi_fig.show_regions("pvslices_finalfig.reg")

co21_fig = FITSFigure(co21_proj.hdu, subplot=(2, 3, 3), figure=fig)
co21_fig.show_grayscale()
co21_fig.hide_xaxis_label()
co21_fig.hide_yaxis_label()
co21_fig.hide_tick_labels()
co21_fig.set_title(r"CO(2-1)")

for path, pnum in zip(paths[4:7], [4, 5, 6]):
    pv = extract_pv_slice(hi_cube, path)
    pv_co21 = extract_pv_slice(co21_cube, path)

    pv_fig = FITSFigure(pv, subplot=(2, 3, pnum), figure=fig)
    pv_fig.show_grayscale()
    pv_fig.show_contour(pv_co21, levels=np.arange(3 * co21_sigma, 20 * co21_sigma, 4 * co21_sigma), colors="g")
开发者ID:e-koch,项目名称:VLA_Lband,代码行数:33,代码来源:ngc604_pvslices.py

示例3: float

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_regions [as 别名]
#import IPython; IPython.embed(); 1/0

# Computing the sub-figure sizes is surprisingly hard
figsize=(5, 15)
figure = mpl.figure(figsize=figsize)
axis_ratio = figsize[0] / float(figsize[1])
edge_margin_x = 0.12
edge_margin_y = edge_margin_x * axis_ratio
edge_margin_x_up = 0.01
edge_margin_y_up = edge_margin_x_up * axis_ratio
inner_margin_x = 0.1
inner_margin_y = inner_margin_x * axis_ratio
size_x = (1 - edge_margin_x - edge_margin_x_up)
size_y = (1 - edge_margin_y - edge_margin_y_up - 2 * inner_margin_y) / 3

for ii, image in enumerate(images):
    subplot = [edge_margin_x, edge_margin_y + ii * (size_y + inner_margin_y), size_x, size_y]
    print('subplot = {0}'.format(subplot))
    f = FITSFigure(image['filename'], figure=figure, subplot=subplot)
    f.recenter(x_center, y_center, 0.95 * radius)
    set_hgps_style(f)
    f.show_colorscale(vmin=-1, vmax=8, stretch='power', exponent=1, cmap='jet') #vmid=-3, stretch='log', )
    if ii == 1:
        f.show_regions('sources.reg')
    else:
        f.show_regions('sources2.reg')

filename = 'icrc2013_89_06.pdf'
print('Writing {}'.format(filename))
figure.savefig(filename)
开发者ID:gammapy,项目名称:enrico-icrc2013-proceedings,代码行数:32,代码来源:plot_images.py

示例4: FITSFigure

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_regions [as 别名]
from aplpy import FITSFigure
import os

mom0_file = "/media/eric/MyRAID/M33/14B-088/HI/full_imaging/M33_14B-088_HI.clean.image.pbcov_gt_0.3_masked.mom0.fits"

fig = FITSFigure(mom0_file)
fig.show_grayscale()
fig.show_regions(os.path.expanduser("~/Dropbox/code_development/VLA_Lband/14B-088/pointings.reg"))
fig.show_regions(os.path.expanduser("~/Dropbox/code_development/VLA_Lband/14B-088/pointing_wrong.reg"))
开发者ID:e-koch,项目名称:VLA_Lband,代码行数:11,代码来源:hi_with_pointings.py


注:本文中的aplpy.FITSFigure.show_regions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。