diff options
Diffstat (limited to 'tksao/frame/fitsimage.C')
-rw-r--r-- | tksao/frame/fitsimage.C | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 0a95930..2b2d09f 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -2789,6 +2789,30 @@ Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, return Vector(); } +VectorStr FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, + Coord::SkyFrame sky, Coord::SkyFormat format) +{ + if (!hasWCS(sys)) + return VectorStr(); + + astClearStatus; // just to make sure + astBegin; // start memory management + + setWCSSystem(sys); + setWCSSkyFrame(sky); + + Vector out = wcsTran(ast_, in, 1); + if (!astOK || !checkWCS(out)) + return VectorStr(); + + setWCSFormat(sys,sky,format); + astNorm(ast_, out.v); + astEnd; + + return VectorStr(astFormat(ast_,1,out[0]), astFormat(ast_,2,out[1])); +} + +// waj char* FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format, char* lbuf) @@ -2818,29 +2842,6 @@ char* FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, return lbuf; } -VectorStr FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys, - Coord::SkyFrame sky, Coord::SkyFormat format) -{ - if (!hasWCS(sys)) - return VectorStr(); - - astClearStatus; // just to make sure - astBegin; // start memory management - - setWCSSystem(sys); - setWCSSkyFrame(sky); - - Vector out = wcsTran(ast_, in, 1); - if (!astOK || !checkWCS(out)) - return VectorStr(); - - setWCSFormat(sys,sky,format); - astNorm(ast_, out.v); - astEnd; - - return VectorStr(astFormat(ast_,1,out[0]), astFormat(ast_,2,out[1])); -} - Vector3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys, Coord::SkyFrame sky) { @@ -2863,6 +2864,32 @@ Vector3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys, return Vector3d(); } +VectorStr3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys, + Coord::SkyFrame sky, Coord::SkyFormat format) +{ + if (!hasWCS(sys)) + return VectorStr3d(); + + astClearStatus; // just to make sure + astBegin; // start memory management + + setWCSSystem(sys); + setWCSSkyFrame(sky); + + Vector out = wcsTran(ast_, in, 1); + if (!astOK || !checkWCS(out)) + return VectorStr3d(); + + setWCSFormat(sys,sky,format); + astNorm(ast_, out.v); + astEnd; + + return VectorStr3d(astFormat(ast_,1,out[0]), + astFormat(ast_,2,out[1]), + astFormat(ast_,3,out[2])); +} + +// waj char* FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format, char* lbuf) |