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


Python FITSFigure.show_grayscale方法代码示例

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


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

示例1: test_colorbar_showhide

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_colorbar_showhide():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_colorbar()
    f.colorbar.hide()
    f.colorbar.show()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:10,代码来源:test_colorbar.py

示例2: test_colorbar_font

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_colorbar_font():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_colorbar()
    f.colorbar.set_font(size='small', weight='bold', stretch='normal',
                        family='serif', style='normal', variant='normal')
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:10,代码来源:test_colorbar.py

示例3: test_colorbar_addremove

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_colorbar_addremove():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_colorbar()
    f.remove_colorbar()
    f.add_colorbar()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:10,代码来源:test_colorbar.py

示例4: test_beam_angle

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_beam_angle():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.beam.set_angle(0.)
    f.beam.set_angle(55.)
    f.close()
开发者ID:lpsinger,项目名称:aplpy,代码行数:10,代码来源:test_beam.py

示例5: test_init_extensive_wcs

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_init_extensive_wcs(header, dimensions):
    hdu = generate_hdu(header)
    if 'CAR' in header:
        f = FITSFigure(hdu, dimensions=dimensions, convention='calabretta')
    else:
        f = FITSFigure(hdu, dimensions=dimensions)
    f.show_grayscale()
    f.add_grid()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:11,代码来源:test_init_image.py

示例6: test_beam_addremove

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_beam_addremove():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.remove_beam()
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.remove_beam()
    f.close()
开发者ID:lpsinger,项目名称:aplpy,代码行数:11,代码来源:test_beam.py

示例7: test_colorbar_pad

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_colorbar_pad():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_colorbar()
    f.colorbar.set_pad(0.1)
    f.colorbar.set_pad(0.2)
    f.colorbar.set_pad(0.5)
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:11,代码来源:test_colorbar.py

示例8: test_colorbar_location

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_colorbar_location():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.add_colorbar()
    f.colorbar.set_location('top')
    f.colorbar.set_location('bottom')
    f.colorbar.set_location('left')
    f.colorbar.set_location('right')
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:12,代码来源:test_colorbar.py

示例9: test_write_eps

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_write_eps(tmpdir, format):
    filename = os.path.join(str(tmpdir), 'test_output.eps')
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.save(filename, format=format)
    f.close()
    if format is None:
        assert is_format(filename, 'eps')
    else:
        assert is_format(filename, format)
开发者ID:lpsinger,项目名称:aplpy,代码行数:13,代码来源:test_save.py

示例10: test_write_stringio

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_write_stringio(tmpdir, format):
    s = StringIO()
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.save(s, format=format)
    f.close()
    s.seek(0)
    if format is None:
        assert is_format(s, 'png')
    else:
        assert is_format(s, format)
开发者ID:lpsinger,项目名称:aplpy,代码行数:14,代码来源:test_save.py

示例11: plot_exposure_image

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [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')
开发者ID:Cadair,项目名称:gammapy,代码行数:24,代码来源:plot_irfs.py

示例12: test_init_dimensions_valid

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_init_dimensions_valid(dimensions):
    hdu = generate_hdu(REFERENCE)
    f = FITSFigure(hdu, dimensions=dimensions, slices=[5])
    f.show_grayscale()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:7,代码来源:test_init_cube.py

示例13: test_hdu_noslices_2d

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_hdu_noslices_2d():
    data = np.zeros((1, 16, 16))
    f = FITSFigure(data)
    f.show_grayscale()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:7,代码来源:test_init_cube.py

示例14: test_numpy_nowcs_init

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_numpy_nowcs_init():
    data = np.zeros((16, 16, 16))
    f = FITSFigure(data, slices=[5])
    f.show_grayscale()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:7,代码来源:test_init_cube.py

示例15: test_hdu_nowcs_init

# 需要导入模块: from aplpy import FITSFigure [as 别名]
# 或者: from aplpy.FITSFigure import show_grayscale [as 别名]
def test_hdu_nowcs_init():
    data = np.zeros((16, 16, 16))
    hdu = pyfits.PrimaryHDU(data)
    f = FITSFigure(hdu, slices=[5])
    f.show_grayscale()
    f.close()
开发者ID:d80b2t,项目名称:python,代码行数:8,代码来源:test_init_cube.py


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