怎样对data cubes做切片

aplpy可以对一个N维fits cubes提取切片,对维度重新排序。有两个重要的参数,dimensions and slices.这两个参数也可以用于show_contour().

dimensions参数用来把维度分配给x或y轴。默认值是[0,1],意思是x轴应该是fits cube的第一个维度,y是第二个维度。对于一个2维fits文件,这意味着,可以用[1,0]来翻转轴。

对于一个fits cube 维度R.A.,Declination, and velocity,[0,2] 将给出R.A.-velocity.

for a fits file with R.A=0.,Declination=1, and velocity=2,time=3,

dimensions=[2,1]  plot velocity and declination  slices=[22,33] means pixel slices in R.A. and time.

f = aplpy.FITSFigure(co_cube, dimensions=[2, 1],
                     slices=[55], figsize=(8, 6))
f.show_colorscale(aspect='auto')
f.add_grid()
f.tick_labels.set_font(size='x-small')
f.axis_labels.set_font(size='small')
f.tick_labels.set_xformat('%.1f')

  

posted @ 2021-04-15 21:50  cql_astro  阅读(118)  评论(0)    收藏  举报