Пример #1
0
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()
Пример #2
0
def test_grid_showhide():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_grid()
    f.grid.hide()
    f.grid.show()
    f.close()
Пример #3
0
def test_beam_pad():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.beam.set_pad(0.1)
    f.beam.set_pad(0.3)
    f.close()
Пример #4
0
def test_frame_linewidth():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.frame.set_linewidth(0)
    f.frame.set_linewidth(1)
    f.frame.set_linewidth(10)
    f.close()
Пример #5
0
def test_grid_addremove():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_grid()
    f.remove_grid()
    f.add_grid()
    f.close()
Пример #6
0
def test_scalebar_frame():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.scalebar.set_frame(True)
    f.scalebar.set_frame(False)
    f.close()
Пример #7
0
def test_ticks_minor_frequency():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.ticks.set_minor_frequency(1)
    f.ticks.set_minor_frequency(5)
    f.ticks.set_minor_frequency(10)
    f.close()
Пример #8
0
def test_ticks_linewidth():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.ticks.set_linewidth(1)
    f.ticks.set_linewidth(3)
    f.ticks.set_linewidth(10)
    f.close()
Пример #9
0
def test_beam_hatch():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    for hatch in ['/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*']:
        f.beam.set_hatch(hatch)
    f.close()
Пример #10
0
def test_beam_frame():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.beam.set_frame(True)
    f.beam.set_frame(False)
    f.close()
Пример #11
0
def test_ticks_color():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.ticks.set_color('black')
    f.ticks.set_color('#003344')
    f.ticks.set_color((1.0, 0.4, 0.3))
    f.close()
Пример #12
0
def test_scalebar_length():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.scalebar.set_length(0.01)
    f.scalebar.set_length(0.1)
    f.close()
Пример #13
0
def test_scalebar_showhide():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.scalebar.hide()
    f.scalebar.show(0.1)
    f.close()
Пример #14
0
def test_scalebar_addremove():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.remove_scalebar()
    f.add_scalebar(0.1)
    f.close()
Пример #15
0
def test_ticks_spacing():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.ticks.set_xspacing(0.5)
    f.ticks.set_xspacing(1.)
    f.ticks.set_yspacing(0.5)
    f.ticks.set_yspacing(1.)
    f.close()
Пример #16
0
def test_grid_linewidth():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_grid()
    f.grid.set_linewidth(0)
    f.grid.set_linewidth(2)
    f.grid.set_linewidth(5)
    f.close()
Пример #17
0
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()
Пример #18
0
def test_beam_linewidth():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.beam.set_linewidth(0)
    f.beam.set_linewidth(1)
    f.beam.set_linewidth(5)
    f.close()
Пример #19
0
def test_beam_edgecolor():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.beam.set_edgecolor('black')
    f.beam.set_edgecolor('#003344')
    f.beam.set_edgecolor((1.0, 0.4, 0.3))
    f.close()
Пример #20
0
def test_scalebar_label():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.scalebar.set_label('1 pc')
    f.scalebar.set_label('5 AU')
    f.scalebar.set_label('2"')
    f.close()
Пример #21
0
 def main(self, figure, subplot):
     filename = FermiGalacticCenter.filenames()['counts']
     self.fits_figure = FITSFigure(filename,
                                   hdu=1,
                                   figure=figure,
                                   subplot=subplot)
     self.fits_figure.show_colorscale(vmin=1, vmax=10, cmap='afmhot')
     self.fits_figure.ticks.set_xspacing(2)
Пример #22
0
def test_axis_labels_position():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.axis_labels.set_xposition('top')
    f.axis_labels.set_xposition('bottom')
    f.axis_labels.set_yposition('right')
    f.axis_labels.set_yposition('left')
    f.close()
Пример #23
0
def test_beam_linestyle():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    f.beam.set_linestyle('solid')
    f.beam.set_linestyle('dotted')
    f.beam.set_linestyle('dashed')
    f.close()
Пример #24
0
def test_scalebar_color():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.scalebar.set_color('black')
    f.scalebar.set_color('#003344')
    f.scalebar.set_color((1.0, 0.4, 0.3))
    f.close()
Пример #25
0
def test_grid_alpha():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_grid()
    f.grid.set_alpha(0.0)
    f.grid.set_alpha(0.3)
    f.grid.set_alpha(1.0)
    f.close()
Пример #26
0
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()
Пример #27
0
def test_beam_corner():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_beam(major=0.1, minor=0.04, angle=10.)
    for corner in ['top', 'bottom', 'left', 'right', 'top left', 'top right',
                   'bottom left', 'bottom right']:
        f.beam.set_corner(corner)
    f.close()
Пример #28
0
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()
Пример #29
0
def test_scalebar_alpha():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_scalebar(0.1)
    f.scalebar.set_alpha(0.1)
    f.scalebar.set_alpha(0.2)
    f.scalebar.set_alpha(0.5)
    f.close()
Пример #30
0
def test_grid_linestyle():
    data = np.zeros((16, 16))
    f = FITSFigure(data)
    f.add_grid()
    f.grid.set_linestyle('solid')
    f.grid.set_linestyle('dashed')
    f.grid.set_linestyle('dotted')
    f.close()