summaryrefslogtreecommitdiffstats
path: root/tksao/frame
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-08-16 17:45:21 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-08-16 17:45:21 (GMT)
commit736fd973a10126328161a31161812ceab39e55d9 (patch)
tree91fc6c559dc106ac05f1c8402a92ca237a70fb34 /tksao/frame
parent2557a11471ce1415d7984c82470343cd4c0ae2bf (diff)
downloadblt-736fd973a10126328161a31161812ceab39e55d9.zip
blt-736fd973a10126328161a31161812ceab39e55d9.tar.gz
blt-736fd973a10126328161a31161812ceab39e55d9.tar.bz2
simplify wcs code
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/fitsimage.C21
1 files changed, 19 insertions, 2 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C
index be7b449..b6b0a1a 100644
--- a/tksao/frame/fitsimage.C
+++ b/tksao/frame/fitsimage.C
@@ -2778,7 +2778,16 @@ Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
astNorm(ast_, out.v);
astEnd;
- return hasWCSCel(sys) ? radToDeg(out) : out;
+
+ if (hasWCSCel(sys)) {
+ int id = sys-Coord::WCS;
+ if (wcsCelLon_[id] == 1 || wcsCelLat_[id] == 1)
+ out[0] = radToDeg(out[0]);
+ if (wcsCelLon_[id] == 2 || wcsCelLat_[id] == 2)
+ out[1] = radToDeg(out[1]);
+ }
+
+ return out;
}
VectorStr FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
@@ -2823,7 +2832,15 @@ Vector3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys,
astNorm(ast_, out.v);
astEnd;
- return hasWCSCel(sys) ? radToDeg(out) : out;
+ if (hasWCSCel(sys)) {
+ int id = sys-Coord::WCS;
+ if (wcsCelLon_[id] == 1 || wcsCelLat_[id] == 1)
+ out[0] = radToDeg(out[0]);
+ if (wcsCelLon_[id] == 2 || wcsCelLat_[id] == 2)
+ out[1] = radToDeg(out[1]);
+ }
+
+ return out;
}
VectorStr3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys,