糟糕的Cutout2D图像图中的坐标不均匀

时间:2018-09-28 02:43:10

标签: image matplotlib projection astropy

我正在使用astropy从SDSS数据库下载和绘制图像。另外,我正在使用Cutout2D函数在我感兴趣的对象周围剪切10x10 arcsec正方形。这是代码:

from astropy.coordinates import SkyCoord
from astroquery.sdss import SDSS
from astropy.wcs import WCS
from astropy import units as u
from astropy.nddata import Cutout2D
import matplotlib.pyplot as plt
import numpy as np

# Coordinates from Skycoord name search
objCoord = SkyCoord(ra=263.7552*u.degree, dec=57.052374*u.degree)

# Get SDSS images
xObj = SDSS.query_region(objCoord, spectro=True)
imgObj = SDSS.get_images(matches=xObj)
image_i = imgObj[0][0]
data_i = image_i.data

# Get image coordinates
wcs = WCS(image_i.header)

# Cut the Field of view 10.0 x 10.0 arcsec
FoV = np.array([10.0, 10.0])
FoV_dimen = u.Quantity((FoV[0], FoV[1]), u.arcsec)
cutout = Cutout2D(data_i, objCoord, FoV_dimen, wcs=wcs)
wcs_cut = cutout.wcs

# Plot the image
fig = plt.figure()
ax = fig.add_subplot(111, projection=wcs_cut)
imgRegion = ax.imshow(cutout.data, origin='lower', vmin=-0.64, vmax=0.45)
ax.scatter(objCoord.ra, objCoord.dec , s=150, linewidths=0.35,  edgecolors='black', transform=ax.get_transform('world'), label='SHOC579')

# Format the image axis
ra, dec = ax.coords[0], ax.coords[1]
ra.set_axislabel('Right ascension')
dec.set_axislabel('Declination')
ra.set_ticks(spacing=1 * u.arcsec, color='white', exclude_overlapping=True)
dec.set_ticks(spacing=1  * u.arcsec, color='white', exclude_overlapping=True)
ra.grid(color='red', alpha=0.5, linestyle='solid')
dec.grid(color='black', alpha=0.5, linestyle='solid')
ax.legend()
plt.show()

它生成此图像:

enter image description here

尽管两个图像轴都被切割了相同的长度,并且轴网格具有相同的1英寸(1 arcsec)分辨率,但右侧上升几乎覆盖了预期角度的两倍。

但是,当您同时使用1英寸(1 arcsec)网格查看SDSS skyserver图像时:

enter image description here

右边的上升网格实际上看起来更近(物体的直径大约6弧秒)

有什么我想念的吗?

0 个答案:

没有答案