熵:确定某个点(RA,DEC)是否在平方区域内,并根据该区域的角点坐标进行确定

时间:2018-08-13 14:58:28

标签: python-3.x coordinate astropy

我具有从获得的天空区域的四个角的坐标 带有***<!DOCTYPE HTML> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="UTF-8"> <title>My Inbox</title> <script id="sap-ui-bootstrap" src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js" data-sap-ui-libs="sap.m" data-sap-ui-theme="sap_belize" data-sap-ui-compatVersion="edge" data-sap-ui-resourceroots='{"cross.fnd.fiori.inbox": "./"}'> </script> <link rel="stylesheet" type="text/css" href="css/style.css"> <script> sap.ui.getCore().attachInit(function() { new sap.m.Shell({ app: new sap.ui.core.ComponentContainer({ height : "100%", name : "cross.fnd.fiori.inbox" }) }).placeAt("content"); }); </script> </head>*** <body class="sapUiBody" id="content"> </body> </html>的标题fits图像和用于获取坐标的投影。

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

在尊重投影效果(如输出所示,所使用的投影为corners=w.calc_footprint() print(corners) [out]: [[308.318759 41.08966578] [308.01327548 41.08869031] [308.01293347 41.31890048] [308.31905451 41.31954629]] )的情况下,如何检查随机坐标是否在由角标坐标定义的区域内?

1 个答案:

答案 0 :(得分:2)

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