From 0b7c0c2ea2333683447d923f9911e053302e29ba Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 19 Dec 2017 16:56:57 -0500 Subject: upgrade AST --- tksao/frame/base.C | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tksao/frame/base.C b/tksao/frame/base.C index 1f20731..9559be3 100644 --- a/tksao/frame/base.C +++ b/tksao/frame/base.C @@ -661,13 +661,11 @@ Matrix Base::calcAlignWCS(FitsImage* fits1, FitsImage* fits2, AstFrameSet* wcs2 = fits2->wcsCopy(); astInvert(wcs2); - AstFrameSet* cvt = (AstFrameSet*)astConvert(wcs1, wcs2, ""); + AstFrameSet* cvt = (AstFrameSet*)astConvert(wcs2, wcs1, ""); if (cvt != AST__NULL) { - astInvert(cvt); - - int naxes1 = astGetI(astGetFrame(cvt,AST__CURRENT),"Naxes"); - int naxes2 = astGetI(astGetFrame(cvt,AST__BASE),"Naxes"); + int naxes1 = astGetI(astGetFrame(cvt,AST__BASE),"Naxes"); + int naxes2 = astGetI(astGetFrame(cvt,AST__CURRENT),"Naxes"); cerr << naxes1 << " x " << naxes2 << endl; Vector ll2 = fits2->center() - Vector(10,10); @@ -683,7 +681,7 @@ Matrix Base::calcAlignWCS(FitsImage* fits1, FitsImage* fits2, ur[2] =1; ur[3] =1; - int ss = (naxes2+1)*naxes1; + int ss = (naxes1+1)*naxes2; double* fit = new double[ss]; double tol = 1; if (astLinearApprox(cvt, ll, ur, tol, fit) == AST__BAD) @@ -691,11 +689,11 @@ Matrix Base::calcAlignWCS(FitsImage* fits1, FitsImage* fits2, for (int ii=0; ii