저는 고정 된 하늘 카메라가 있고 WCS 솔루션 (픽셀 x, y를 alt, az로 매핑)에 적합하고 싶습니다. 나는 몇 가지 별을 식별하는 경우, 나는 복합 모델을 그냥 proj_aff = Sky2Pix_ZEA + AffineTransformation2D
말을 한 후 astropy.modeling.fitting에 그를 공급하는 astropy의 능력을 사용하고 싶습니다 thusly 히천체와 식별 된 별을 사용한 WCS 좌표 솔루션
import numpy as np
from astropy.modeling import models, fitting
from astropy.modeling.projections import Sky2Pix_ZEA, AffineTransformation2D
from scipy.optimize import minimize
# Stars of known x,y on chip and alt,az in sky.
star_obs = np.array([('Achernar', 3441.0, 2918.0, 49.947050461141515, 215.1280625253878),
('Achernar', 3576.0, 3018.0, 43.715460044327585, 217.98734214492922),
('Betelgeuse', 2123.0, 971.0, 43.319872170968644, 40.984431336638984),
('Betelgeuse', 2330.0, 956.0, 47.122656796538564, 32.091831385823845),
('Betelgeuse', 2677.0, 949.0, 51.30177229534061, 14.886238412655885),
('Canopus', 2221.0, 2671.0, 55.59320568854928, 141.12216403321605)],
dtype=[('star_name', 'S10'), ('x', '<f8'), ('y', '<f8'),
('alt', '<f8'), ('az', '<f8')])
class sky2pix(object):
def __init__(self, x, y, alt, az):
projection = Sky2Pix_ZEA()
self.affine = AffineTransformation2D()
self.x = x
self.y = y
self.projx, self.projy = projection(az, alt)
def __call__(self, x0):
self.affine.translation.value = x0[0:2]
self.affine.matrix.value = x0[2:]
newx, newy = self.affine(self.projx, self.projy)
residuals = np.sum((newx - self.x)**2 + (newy-self.y)**2)
return residuals
fun = sky2pix(star_obs['x'], star_obs['y'], star_obs['alt'], star_obs['az'])
x0 = np.array([np.median(star_obs['x']), np.median(star_obs['y']), 1., 0., 0., 1.])
fit_result = minimize(fun, x0)
초기 솔루션을 얻을 수 있습니다 루틴,하지만 난 2 개의 출력을 반환 AffineTransformation2D
다루는 방법을 말할 수 없습니다.
[astrometry.net] (http://astrometry.net)을 사용해 보셨나요? 이 질문에 직접 대답하지는 않지만 그럼에도 문제를 해결할 수 있습니다. – Thucydides411
예. Astrometry.net은 어안 렌즈에 적합하지 않으므로 천정 근처의 작은 컷 아웃을 제공하면 수렴 할 수 있습니다. –