diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-09-14 19:38:30 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-09-14 19:38:30 (GMT) |
commit | fda35a7fbab46564792a2410a12d7d6e85904465 (patch) | |
tree | e030c81b67a558ae4fc131ea7af5c0d897649bc1 | |
parent | 2f5962654cfc46093598257f98c18d2a61816b1f (diff) | |
download | blt-fda35a7fbab46564792a2410a12d7d6e85904465.zip blt-fda35a7fbab46564792a2410a12d7d6e85904465.tar.gz blt-fda35a7fbab46564792a2410a12d7d6e85904465.tar.bz2 |
new AST support
-rw-r--r-- | tksao/frame/fitsimage.C | 30 | ||||
-rw-r--r-- | tksao/frame/framebase.C | 17 |
2 files changed, 38 insertions, 9 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 5e31736..0c6b26b 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -2981,11 +2981,10 @@ Coord::Orientation FitsImage::getWCSOrientation(Coord::CoordSystem sys, Coord::Orientation rr = Coord::NORMAL; if (!(isnan(ang)||isinf(ang)||(ang == -DBL_MAX)||(ang == DBL_MAX))) { if (astIsASkyFrame(astGetFrame(ast_[ss], AST__CURRENT))) - rr = ang>0 ? Coord::NORMAL : Coord::XX; + rr = ang>=0 ? Coord::NORMAL : Coord::XX; else - rr = ang<0 ? Coord::NORMAL : Coord::XX; + rr = ang<=0 ? Coord::NORMAL : Coord::XX; } - astEnd; // now, clean up memory return rr; } @@ -3461,22 +3460,47 @@ void FitsImage::astinit(int ii, FitsHead* hd, FitsHead* prim) if (!ast_[ii]) return; + #else + + // astClearStatus; // just to make sure + // astBegin; // start memory management + ast_[ii] = fits2ast(hd); if (!ast_[ii]) return; + // astShow(ast_[ii]); + int naxes = astGetI(ast_[ii],"Naxes"); + switch (naxes) { + case 1: + break; + case 2: + break; + default: + { + // const int pick[] = {1,2}; + // AstMapping* map; + // AstFrame* fm = (AstFrame*)astPickAxes(ast_[ii], 2, pick, &map); + // astShow(fm); + } + break; + } + if (astIsASkyFrame(astGetFrame(ast_[ii], AST__CURRENT))) { if (astGetI(ast_[ii],"LatAxis") == 1) { int orr[] = {2,1}; astPermAxes(ast_[ii],orr); } } + + // astEnd; // now, clean up memory #endif // set default skyframe if (astIsASkyFrame(astGetFrame(ast_[ii], AST__CURRENT))) setAstSkyFrame(ast_[ii],Coord::FK5); + } void FitsImage::astinit0(int ii, FitsHead* hd, FitsHead* prim) diff --git a/tksao/frame/framebase.C b/tksao/frame/framebase.C index 50e4077..ae09414 100644 --- a/tksao/frame/framebase.C +++ b/tksao/frame/framebase.C @@ -231,12 +231,17 @@ void FrameBase::updatePanner() if (keyContext->fits && keyContext->fits->hasWCS(wcsSystem_)) { double rr = keyContext->fits->getWCSRotation(wcsSystem_, wcsSky_); Matrix mx; - switch (keyContext->fits->getWCSOrientation(wcsSystem_, wcsSky_)) { - case Coord::XX: - mx *= FlipX(); - break; - default: - break; + + AstFrameSet* aa = keyContext->fits->getAST(wcsSystem_); + Coord::Orientation oo = + keyContext->fits->getWCSOrientation(wcsSystem_, wcsSky_); + if (astIsASkyFrame(astGetFrame(aa, AST__CURRENT))) { + if (oo==Coord::XX) + mx *= FlipX(); + } + else { + if (oo==Coord::NORMAL) + mx *= FlipX(); } mx *= Rotate(rr)*mm; Vector north = (Vector(0,1)*mx).normalize(); |