summaryrefslogtreecommitdiffstats
path: root/tksao/frame/fitsmap.C
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-11-28 20:52:54 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-11-28 20:52:54 (GMT)
commitb2cc5ad648b5d1365539621eb0f66941bbc54fbf (patch)
treeb37a7c7810389ddcc4e055b711a5054076e8e5a7 /tksao/frame/fitsmap.C
parentafaa3e2a8eab1a073f560e2ebedde31b7d07850f (diff)
downloadblt-b2cc5ad648b5d1365539621eb0f66941bbc54fbf.zip
blt-b2cc5ad648b5d1365539621eb0f66941bbc54fbf.tar.gz
blt-b2cc5ad648b5d1365539621eb0f66941bbc54fbf.tar.bz2
update AST WCS
Diffstat (limited to 'tksao/frame/fitsmap.C')
-rw-r--r--tksao/frame/fitsmap.C31
1 files changed, 11 insertions, 20 deletions
diff --git a/tksao/frame/fitsmap.C b/tksao/frame/fitsmap.C
index 01b2fa9..9dac991 100644
--- a/tksao/frame/fitsmap.C
+++ b/tksao/frame/fitsmap.C
@@ -179,36 +179,27 @@ double FitsImage::mapLenFromRef(double dd, Coord::CoordSystem sys,
setWCSSkyFrame(newast_, Coord::FK5);
maperr =0;
- Vector cc = center();
- double xx[2], wxx[2];
- xx[0] = cc[0];
- xx[1] = cc[0];
- double yy[2], wyy[2];
- yy[0] = cc[1];
- yy[1] = cc[1]+dd;
- wcsTran(newast_,2,xx,yy,1,wxx,wyy);
-
- double pt0[3];
- pt0[0] = wxx[0];
- pt0[1] = wyy[0];
- double pt1[3];
- pt1[0] = wxx[1];
- pt1[1] = wyy[1];
- double out = wcsDistance(newast_,pt0,pt1);
+ Vector in[2];
+ Vector out[2];
+ in[0] = center();
+ in[1] = center()+Vector(0,dd);
+ wcsTran(newast_, 2, in, 1, out);
+ double dd = wcsDistance(newast_,out[0],out[1]);
+
if (wcsIsASkyFrame(newast_)) {
- out = radToDeg(out);
+ dd = radToDeg(dd);
switch (dist) {
case Coord::DEGREE:
break;
case Coord::ARCMIN:
- out *= 60.;
+ dd *= 60.;
break;
case Coord::ARCSEC:
- out *= 60.*60.;
+ dd *= 60.*60.;
break;
}
}
- return out;
+ return dd;
}
}