summaryrefslogtreecommitdiffstats
path: root/tksao/frame
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-12-06 20:19:46 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-12-06 20:19:46 (GMT)
commitff5e670fccf09a18130da3dc776ac2de44a16c99 (patch)
tree346e118256d88f377262c1f27cc9a27207dfcbeb /tksao/frame
parentab62ec42067680f2c417af7edf0e84dcc5a9a82a (diff)
downloadblt-ff5e670fccf09a18130da3dc776ac2de44a16c99.zip
blt-ff5e670fccf09a18130da3dc776ac2de44a16c99.tar.gz
blt-ff5e670fccf09a18130da3dc776ac2de44a16c99.tar.bz2
update AST WCS
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/grid3d.C32
1 files changed, 8 insertions, 24 deletions
diff --git a/tksao/frame/grid3d.C b/tksao/frame/grid3d.C
index d5e1778..4b7523d 100644
--- a/tksao/frame/grid3d.C
+++ b/tksao/frame/grid3d.C
@@ -81,33 +81,11 @@ int Grid3d::doit(RenderMode rm)
break;
default:
{
- // imageToData frame/map
- double ss[] = {-.5, -.5};
- AstShiftMap *sm = astShiftMap(2, ss, " ");
- AstFrame *df = astFrame(2, "Domain=DATA");
-
// Get 2D SkyFrame
AstFrameSet* ast = (AstFrameSet*)astCopy(fits->getAST(system_));
if (fits->wcsIsASkyFrame(ast))
fits->setWCSSkyFrame(ast, sky_);
- // Record the index of the current Frame
- int isky = astGetI(ast, "Current");
-
- // Add the new DATA Frame into the FrameSet, using the ShiftMap to
- // connect it to the existing IMAGE Frame.
- astAddFrame(ast, AST__BASE, sm, df);
-
- // The above call to astAddFrame will have changed the current Frame
- // in the FrameSet to be the new DATA Frame. First record the index of
- // the DATA Frame, and then re-instate the original current Frame (i.e.
- // the SKY Frame).
- int idata = astGetI(ast, "Current");
- astSetI(ast, "Current", isky);
-
- // make the DATA Frame the new base Frame
- astSetI(ast, "Base", idata);
-
// Create two 1D Frames and a 1D Mapping describing the third axis
AstFrame* zbase = astFrame(1,"");
AstFrame* zcurr = astFrame(1,"");
@@ -134,8 +112,14 @@ int Grid3d::doit(RenderMode rm)
AstCmpMap* cmpwcsmap = astCmpMap(wcsmap,zmap,0,"");
// Construct the 3D FrameSet from the new 3D Frames and Mapping
- frameSet = astFrameSet(cmpwcsbase,"");
- astAddFrame(frameSet, AST__CURRENT, cmpwcsmap, cmpwcscurr);
+ AstFrameSet* fs3d = astFrameSet(cmpwcsbase,"");
+ astAddFrame(fs3d, AST__CURRENT, cmpwcsmap, cmpwcscurr);
+
+ // add wcs to frameset
+ // this will link frameset to wcs with unitMap
+ astInvert(fs3d);
+ astAddFrame(frameSet, AST__CURRENT, astUnitMap(3,""), fs3d);
+ astSetI(frameSet,"Current",astGetI(frameSet,"nframe"));
}
}