本文整理汇总了Python中aplpy.FITSFigure类的典型用法代码示例。如果您正苦于以下问题:Python FITSFigure类的具体用法?Python FITSFigure怎么用?Python FITSFigure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FITSFigure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_scalebar_font
def test_scalebar_font():
data = np.zeros((16, 16))
f = FITSFigure(data)
f.add_scalebar(0.1)
f.scalebar.set_font(size='small', weight='bold', stretch='normal',
family='serif', style='normal', variant='normal')
f.close()
示例2: test_beam_pad
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()
示例3: test_beam_hatch
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()
示例4: test_frame_linewidth
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: test_beam_frame
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()
示例6: GPSFermiPlot
class GPSFermiPlot(GalacticPlaneSurveyPanelPlot):
def main(self, figure, subplot):
filename = FermiGalacticCenter.filenames()['counts']
self.fits_figure = FITSFigure(filename, figure=figure, subplot=subplot)
self.fits_figure.show_colorscale(vmin=1, vmax=10)
self.fits_figure.ticks.set_xspacing(2)
示例7: test_ticks_color
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()
示例8: test_ticks_linewidth
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: test_scalebar_length
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()
示例10: test_grid_showhide
def test_grid_showhide():
data = np.zeros((16, 16))
f = FITSFigure(data)
f.add_grid()
f.grid.hide()
f.grid.show()
f.close()
示例11: test_scalebar_frame
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()
示例12: test_scalebar_showhide
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()
示例13: test_ticks_minor_frequency
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()
示例14: part_8
def part_8():
object_list = ['ROXs12','ROXs42B','ROXs42B']
filename_list = ['ROXs12','ROXs42Bb','ROXs42Bc']
for i in range(len(filename_list)):
outfile = open('position_'+filename_list[i]+'.dat','w')
outfile.write('# '+'%25s'%'file name\t'\
+'%12s'%'x planet\t'\
+'%12s'%'y planet\t'\
+'%12s'%'position angle\t'\
+'%12s'%'projected separation (pixels)\n')
if filename_list[i] == 'ROXs12': int_x,int_y = 562,685
elif filename_list[i] == 'ROXs42Bb': int_x,int_y = 629,495
elif filename_list[i] == 'ROXs42Bc': int_x,int_y = 546,465
parts = ['','_CMsub','_ADIsub','_bPSFsub']
for j in parts:
filename = object_list[i]+j+'_aligned_median.fits'
fit_radius = 16
f = fits.open(filename)
scidata = f[0].data
x_data = scidata[int_y,int_x-fit_radius:int_x+fit_radius+1]
x_data -= min(x_data)
fit_x = np.linspace(-fit_radius,fit_radius,1+2*fit_radius)
xfitParam, xfitCovar = curve_fit(gaussian_pdf,fit_x,x_data)
y_data = scidata[int_y-fit_radius:int_y+fit_radius+1,int_x]
y_data -= min(y_data)
fit_y = np.linspace(-fit_radius,fit_radius,1+2*fit_radius)
yfitParam, yfitCovar = curve_fit(gaussian_pdf,fit_y,y_data)
thisPARANG = f[0].header['PARANG']
thisROTPPOSN = f[0].header['ROTPPOSN']
thisEL = f[0].header['EL']
thisINSTANGL = f[0].header['INSTANGL']
PA_yaxis = thisPARANG +thisROTPPOSN -thisEL -thisINSTANGL
PA_planet = PA_yaxis -rad_to_deg(arctan2(float(xfitParam[0]+int_x-512),float(yfitParam[0]+int_y-512)))
if PA_planet < 0: PA_planet += 360
outfile.write('%25s'%str(object_list[i]+j+'_aligned_median.fits')+'\t'\
+'%8s'%'%.3f'%(float(xfitParam[0]+int_x))+'\t'\
+'%8s'%'%.3f'%(float(yfitParam[0]+int_y))+'\t'\
+'%8s'%'%.3f'%(float(PA_planet))+'\t'\
+'%8s'%'%.3f'%(float(sqrt((xfitParam[0]+int_x-512)**2+(yfitParam[0]+int_y-512)**2)))+'\n')
tf = FITSFigure(filename)
tf.show_colorscale(cmap='gray')
tf.add_colorbar()
tf.colorbar.show(location='top',box_orientation='horizontal')
plt.savefig(object_list[i]+j+'_aligned_median.pdf',dpi=200)
plt.close()
outfile.close()
示例15: test_ticks_spacing
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()