From 4a95d7d2042b5c25e992afefe5004d8d8b774a7c Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 31 Jul 2018 11:44:42 -0400 Subject: fix wcsToRef for mosaicimage wcs --- tksao/frame/base.C | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tksao/frame/base.C b/tksao/frame/base.C index 47a4a10..3b99ba7 100644 --- a/tksao/frame/base.C +++ b/tksao/frame/base.C @@ -635,12 +635,14 @@ Matrix Base::calcAlignWCS(FitsImage* fits1, FitsImage* fits2, Vector orpix2 = fits2->wcs2pix(orval2,sys2,sky) * imageToData; - return Translate(-orpix2) * + Matrix rr = Translate(-orpix2) * flip * Scale(zoom) * Rotate(rotation) * Translate(orpix2) * Translate(origin); + + return rr; } } #else @@ -691,13 +693,17 @@ Matrix Base::calcAlignWCS(FitsImage* fits1, FitsImage* fits2, double* fit = new double[ss]; double tol = 1; if (astLinearApprox(cvt, ll, ur, tol, fit) != AST__BAD) - rr = Matrix(fit[naxes2], fit[naxes2+naxes1], + rr = dataToImage * + Matrix(fit[naxes2], fit[naxes2+naxes1], fit[naxes2+1], fit[naxes2+naxes1+1], - fit[0], fit[1]); + fit[0], fit[1]) * + imageToData; + if (fit) delete [] fit; astEnd; // now, clean up memory + return rr; } #endif -- cgit v0.12