diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-11-09 19:47:53 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-11-09 19:47:53 (GMT) |
commit | 7b28cd13e40985a37457bd0a858cea6ce33796c3 (patch) | |
tree | 96681d9d7faad5ffcb5a14c7d5b5e8d6a79b893c /tksao/frame | |
parent | 5e9b73e09b0483a8b92215b1ec2d0893de730232 (diff) | |
download | blt-7b28cd13e40985a37457bd0a858cea6ce33796c3.zip blt-7b28cd13e40985a37457bd0a858cea6ce33796c3.tar.gz blt-7b28cd13e40985a37457bd0a858cea6ce33796c3.tar.bz2 |
update AST WCS
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/fitsimage.C | 1 | ||||
-rw-r--r-- | tksao/frame/grid2d.C | 37 |
2 files changed, 9 insertions, 29 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 0c7eba5..668b1bb 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -4075,7 +4075,6 @@ void FitsImage::setAstWCSFormat(AstFrameSet* aa, int id, const char* format) void FitsImage::setAstWCSSkyFrame(AstFrameSet* ast, Coord::SkyFrame sky) { - return; // is sky frame if (!astWCSIsASkyFrame(ast)) return; diff --git a/tksao/frame/grid2d.C b/tksao/frame/grid2d.C index aea9320..7494868 100644 --- a/tksao/frame/grid2d.C +++ b/tksao/frame/grid2d.C @@ -82,15 +82,11 @@ int Grid2d::doit(RenderMode rm) astAddFrame(frameSet,2,astUnitMap(2,""),ast); astSetI(frameSet,"current",astGetI(frameSet,"nframe")); #else - astClearStatus; // just to make sure - astBegin; // start memory management - AstFrameSet* ast = (AstFrameSet*)astCopy(fits->getAST(system_)); fits->setAstWCSSystem(ast, system_); fits->setAstWCSSkyFrame(ast, sky_); - int offset =0; int naxes = astGetI(ast,"Naxes"); switch (naxes) { case 1: @@ -100,40 +96,25 @@ int Grid2d::doit(RenderMode rm) case 4: { int pick[2] = {1, 2}; + AstMapping* map =NULL; + AstFrame* perm =NULL; + astInvert(ast); - AstMapping* mapb =NULL; - AstFrame* permb = (AstFrame*)astPickAxes(ast, 2, pick, &mapb); - astAddFrame(ast, AST__CURRENT, mapb, permb); + perm = (AstFrame*)astPickAxes(ast, 2, pick, &map); + astAddFrame(ast, AST__CURRENT, map, perm); astInvert(ast); - AstMapping** mapc =NULL; - AstFrame* permc = (AstFrame*)astPickAxes(ast, 2, pick, &mapc); - astAddFrame(ast, AST__CURRENT, mapc, permc); - - if (0) { - int isky = astGetI(ast, "Current"); - int pickb[4] = {1, 2, 0, 0}; - AstMapping* mapb; - AstFrame* foo = astFrame(2,"Domain=DATA"); - astPickAxes(foo, naxes, pickb, &mapb); - astInvert(mapb); - astAddFrame(ast, AST__BASE, mapb, foo); - int idata = astGetI(ast, "Current"); - astSetI(ast, "Current", isky); - astSetI(ast, "Base", idata); - offset =1; - } + perm = (AstFrame*)astPickAxes(ast, 2, pick, &map); + astAddFrame(ast, AST__CURRENT, map, perm); } break; } - + // add wcs to frameset // this will link frameset to wcs with unitMap astInvert(ast); astAddFrame(frameSet, AST__CURRENT, astUnitMap(2,""), ast); - astSetI(frameSet,"Current",astGetI(frameSet,"nframe")-offset); - - astEnd; // now, clean up memory + astSetI(frameSet,"Current",astGetI(frameSet,"nframe")); #endif } } |