python-3.x - Astropy:确定一个点(RA,DEC)是否在给定该区域角坐标的方形区域内

标签 python-3.x coordinate astropy

我有从中获得的天空区域的 4 个角的坐标 header 适合图像与astropy.wcs和用于获取坐标的投影。

import astropy.wcs as wcs
import astropy.fits as fits
hdu=fits.open('filenmae.fits')
w=wcs.WCS(hdu[0].header)
print(w)

哪些输出:

[out]: WCS Keywords
Number of WCS axes: 2
CTYPE : 'RA---ZPN'  'DEC--ZPN'  
CRVAL : 308.45901  41.424847  
CRPIX : 6010.0186  -1881.9392  
CD1_1 CD1_2  : 1.0754576e-07  -5.5698074e-05  
CD2_1 CD2_2  : 5.5690351e-05  6.8120784e-08  
NAXIS : 4119  4119

我从中得到了 field 角落的坐标:

corners=w.calc_footprint()
print(corners)


[out]: [[308.318759    41.08966578]
 [308.01327548  41.08869031]
 [308.01293347  41.31890048]
 [308.31905451  41.31954629]]

如何在尊重投影效果的同时检查随机坐标是否在角点坐标定义的区域内(如输出所示,使用的投影是 ZPN)?

最佳答案

一般来说,如果您有一个可以通过 WCS 转换为天空坐标的局部坐标系(比如图像像素),那么一种策略是将“随机坐标”转换为局部像素坐标并进行区域测试在那个平坦的直线坐标系中。

关于python-3.x - Astropy:确定一个点(RA,DEC)是否在给定该区域角坐标的方形区域内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51825235/

相关文章:

python - 在 os x 上使用 python3 安装 pyside

python - 使用 Python 从文本文件中提取数据

php - 正则表达式 X/Y 坐标

python - Astropy 中的坐标变换

python - Group_by 不适用于具有 mixin 列的表 [Astropy、Table]

python - 在Raspberry pi 3中安装openCV失败

linux - 摆脱僵尸进程

javascript - THREE.js 获取物体的局部坐标系

GPS 转换 - 像素坐标到 GPS 坐标

python - 将赤道转换为alt-az坐标非常慢