diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-12-01 18:53:02 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-12-01 18:53:02 (GMT) |
commit | 22c2af20292ad702d34c76c20f07a834f9507a38 (patch) | |
tree | 6c9fb62558ccd2c1b96d249ef423f5d3cf7c7bbf /tksao/frame | |
parent | 0ac30d54eacb312e66199cf6199f16a30d4ce64b (diff) | |
download | blt-22c2af20292ad702d34c76c20f07a834f9507a38.zip blt-22c2af20292ad702d34c76c20f07a834f9507a38.tar.gz blt-22c2af20292ad702d34c76c20f07a834f9507a38.tar.bz2 |
update AST WCS
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/fitsimage.C | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 88a64d1..44bf50d 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -3105,21 +3105,16 @@ Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, astClearStatus; int ss = sys-Coord::WCS; - if (ss>=0 && ast_ && ast_[ss]) { - if (wcsIsASkyFrame(ast_[ss])) { - setWCSSkyFrame(ast_[ss],sky); - Vector out = wcsTran(ast_[ss], in, 1); - if (astOK && checkWCS(out)) - return radToDeg(out); - } - else { - Vector out = wcsTran(ast_[ss], in, 1); - if (astOK && checkWCS(out)) - return out; - } - } + if (!(ss>=0 && ast_ && ast_[ss])) + return Vector(); + + setWCSSkyFrame(ast_[ss],sky); - return Vector(); + Vector out = wcsTran(ast_[ss], in, 1); + if (astOK && checkWCS(out)) + return wcsIsASkyFrame(ast_[ss]) ? radToDeg(out) : out; + else + return Vector(); } #else Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, @@ -3134,14 +3129,10 @@ Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, setWCSSkyFrame(newast_,sky); Vector out = wcsTran(newast_, in, 1); - if (astOK && checkWCS(out)) { - if (wcsIsASkyFrame(newast_)) - return radToDeg(out); - else - return out; - } - - return Vector(); + if (astOK && checkWCS(out)) + return wcsIsASkyFrame(newast_) ? radToDeg(out) : out; + else + return Vector(); } Vector3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys, @@ -3156,14 +3147,10 @@ Vector3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys, setWCSSkyFrame(newast_,sky); Vector3d out = wcsTran(newast_, in, 1); - if (astOK && checkWCS(out)) { - if (wcsIsASkyFrame(newast_)) - return radToDeg(out); - else - return out; - } - - return Vector3d(); + if (astOK && checkWCS(out)) + return wcsIsASkyFrame(newast_) ? radToDeg(out) : out; + else + return Vector3d(); } #endif |