summaryrefslogtreecommitdiffstats
path: root/tksao
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-12-06 20:12:55 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-12-06 20:12:55 (GMT)
commitab62ec42067680f2c417af7edf0e84dcc5a9a82a (patch)
tree4bc37947f07b86b3769412a8624f99eaa3e0a59b /tksao
parenta4c5bcb94b1e026c29889233daf1c84c015a4a6d (diff)
downloadblt-ab62ec42067680f2c417af7edf0e84dcc5a9a82a.zip
blt-ab62ec42067680f2c417af7edf0e84dcc5a9a82a.tar.gz
blt-ab62ec42067680f2c417af7edf0e84dcc5a9a82a.tar.bz2
update AST WCS
Diffstat (limited to 'tksao')
-rw-r--r--tksao/frame/grid3d.C56
-rw-r--r--tksao/frame/grid3d.h4
2 files changed, 6 insertions, 54 deletions
diff --git a/tksao/frame/grid3d.C b/tksao/frame/grid3d.C
index fe08822..d5e1778 100644
--- a/tksao/frame/grid3d.C
+++ b/tksao/frame/grid3d.C
@@ -70,23 +70,14 @@ int Grid3d::doit(RenderMode rm)
astClearStatus; // just to make sure
astBegin; // start memory management
- AstFrameSet* frameSet = NULL;
- AstPlot3D* plot = NULL;
- FitsBound* params = fits->getDataParams(context->secMode());
- FitsZBound* zparams = context->getDataParams(context->secMode());
+ AstFrameSet* frameSet = astFrameSet(astFrame(3,"Domain=Ref"),"");
+ matrixMap(frameSet,fits->refToImage3d,"Domain=IMAGE");
switch (system_) {
case Coord::IMAGE:
- frameSet = (AstFrameSet*)matrixMap(fits->refToImage,"Domain=IMAGE");
- break;
case Coord::PHYSICAL:
- frameSet = (AstFrameSet*)matrixMap(fits->refToPhysical,"Domain=PHYSICAL");
- break;
case Coord::AMPLIFIER:
- frameSet = (AstFrameSet*)matrixMap(fits->refToAmplifier,"Domain=AMPLIFIER");
- break;
case Coord::DETECTOR:
- frameSet = (AstFrameSet*)matrixMap(fits->refToDetector,"Domain=DETECTOR");
break;
default:
{
@@ -148,9 +139,6 @@ int Grid3d::doit(RenderMode rm)
}
}
- if (!frameSet)
- return 0;
-
astSet(frameSet,"Title=%s", " ");
// create astPlot
@@ -158,6 +146,8 @@ int Grid3d::doit(RenderMode rm)
double pbox[6];
// params is a BBOX in DATA coords 0-n
+ FitsBound* params = fits->getDataParams(context->secMode());
+ FitsZBound* zparams = context->getDataParams(context->secMode());
Vector3d ll = Vector3d(params->xmin,params->ymin,zparams->zmin);
Vector3d ur = Vector3d(params->xmax,params->ymax,zparams->zmax);
@@ -172,7 +162,7 @@ int Grid3d::doit(RenderMode rm)
astGrid3dPtr = this;
renderMode_ = rm;
- plot = astPlot3D(frameSet, gbox, pbox, option_);
+ AstPlot3D* plot = astPlot3D(frameSet, gbox, pbox, option_);
// astShow(plot);
astGrid(plot);
@@ -181,38 +171,6 @@ int Grid3d::doit(RenderMode rm)
return 1;
}
-void* Grid3d::matrixMap(Matrix& mx, const char* str)
-{
- double ss[] = {mx.matrix(0,0),mx.matrix(1,0),
- mx.matrix(0,1),mx.matrix(1,1)};
- double tt[] = {mx.matrix(2,0),mx.matrix(2,1)};
-
- AstMatrixMap* mm;
- if (!(mm= astMatrixMap(2,2,0,ss,"")))
- return NULL;
-
- AstShiftMap* sm;
- if (!(sm = astShiftMap(2,tt,"")))
- return NULL;
-
- AstCmpMap* mapxy;
- if (!(mapxy = astCmpMap(mm,sm,1,"")))
- return NULL;
-
- double uu =.5;
- AstShiftMap* mapz = astShiftMap(1,&uu,"");
-
- AstCmpMap* cmp = astCmpMap(mapxy,mapz,0,"");
-
- AstFrame* in = astFrame(3,"Domain=REF");
- AstFrame* out = astFrame(3,str);
-
- AstFrameSet* frameSet = astFrameSet(in,"");
- astAddFrame(frameSet,AST__CURRENT,cmp,out);
-
- return frameSet;
-}
-
#else
int Grid3d::doit(RenderMode rm)
@@ -323,6 +281,7 @@ int Grid3d::doit(RenderMode rm)
return 1;
}
+#endif
void Grid3d::matrixMap(void* frameSet, Matrix3d& mx, const char* str)
{
@@ -337,6 +296,3 @@ void Grid3d::matrixMap(void* frameSet, Matrix3d& mx, const char* str)
astAddFrame((AstFrameSet*)frameSet, AST__CURRENT, cmp, astFrame(3, str));
}
-
-#endif
-
diff --git a/tksao/frame/grid3d.h b/tksao/frame/grid3d.h
index 9a3341d..b3c85cf 100644
--- a/tksao/frame/grid3d.h
+++ b/tksao/frame/grid3d.h
@@ -11,11 +11,7 @@
class Grid3d : public Grid, public Grid3dBase {
private:
-#ifndef NEWWCS
- void* matrixMap(Matrix&, const char*);
-#else
void matrixMap(void*, Matrix3d&, const char*);
-#endif
int doit(RenderMode);
public: