diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-07-09 21:27:25 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-07-09 21:27:25 (GMT) |
commit | 3c6b25616a5b4c97849f1d0846cae4d66d762b61 (patch) | |
tree | 4c8fd2b25c7f9427ec800c34b927495b875c1f8c | |
parent | c0f354fdb8d4001f125e461392ad4c5da7783a0d (diff) | |
download | blt-3c6b25616a5b4c97849f1d0846cae4d66d762b61.zip blt-3c6b25616a5b4c97849f1d0846cae4d66d762b61.tar.gz blt-3c6b25616a5b4c97849f1d0846cae4d66d762b61.tar.bz2 |
simply ast grid code
-rw-r--r-- | tksao/frame/base.C | 4 | ||||
-rw-r--r-- | tksao/frame/fitsimage.C | 4 | ||||
-rw-r--r-- | tksao/frame/fitsimage.h | 12 | ||||
-rw-r--r-- | tksao/frame/grid25d.C | 4 | ||||
-rw-r--r-- | tksao/frame/grid2d.C | 5 | ||||
-rw-r--r-- | tksao/frame/grid3d.C | 5 |
6 files changed, 18 insertions, 16 deletions
diff --git a/tksao/frame/base.C b/tksao/frame/base.C index 5f780a3..20ad79f 100644 --- a/tksao/frame/base.C +++ b/tksao/frame/base.C @@ -659,10 +659,10 @@ Matrix Base::calcAlignWCS(FitsImage* fits1, FitsImage* fits2, astBegin; // start memory management fits1->setWCSSkyFrame(sys1, sky); - AstFrameSet* wcs1 = fits1->wcsCopy(); + AstFrameSet* wcs1 = (AstFrameSet*)astCopy(fits1->ast_); astInvert(wcs1); fits2->setWCSSkyFrame(sys2, sky); - AstFrameSet* wcs2 = fits2->wcsCopy(); + AstFrameSet* wcs2 = (AstFrameSet*)astCopy(fits2->ast_); astInvert(wcs2); AstFrameSet* cvt = (AstFrameSet*)astConvert(wcs2, wcs1, ""); diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 86be509..229801a 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -1667,10 +1667,10 @@ void FitsImage::match(const char* xxname1, const char* yyname1, Vector* ptr1 =NULL; if (sky1 != sky2) { setWCSSkyFrame(sys1, sky1); - AstFrameSet* wcs1 = wcsCopy(); + AstFrameSet* wcs1 = (AstFrameSet*)astCopy(ast_); setWCSSkyFrame(sys2, sky2); - AstFrameSet* wcs2 = wcsCopy(); + AstFrameSet* wcs2 = (AstFrameSet*)astCopy(ast_); AstFrameSet* cvt = (AstFrameSet*)astConvert(wcs1, wcs2, "SKY"); if (cvt != AST__NULL) { diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h index 687d2bd..b5f63a9 100644 --- a/tksao/frame/fitsimage.h +++ b/tksao/frame/fitsimage.h @@ -113,10 +113,8 @@ class FitsImage { int manageWCS_; #ifndef NEWWCS WorldCoor** wcs_; // wcs list - AstFrameSet** ast_; // ast frameset; WCSx** wcsx_; // xth Axis WCS #else - AstFrameSet* ast_; // ast frameset; int astInv_; // can we inverse? int* wcs_; int* wcsEqu_; @@ -129,6 +127,13 @@ class FitsImage { Matrix wcsToRef_; // iraf/wcs matrix + public: +#ifndef NEWWCS + AstFrameSet** ast_; // ast frameset; +#else + AstFrameSet* ast_; // ast frameset; +#endif + private: char* root(const char*); char* strip(const char*); @@ -414,8 +419,6 @@ class FitsImage { WorldCoor* getWCS(Coord::CoordSystem sys) {return (wcs_ && wcs_[sys-Coord::WCS]) ? wcs_[sys-Coord::WCS] : NULL;} Vector getWCScdelt(Coord::CoordSystem); - AstFrameSet* getAST(Coord::CoordSystem sys) - {return (ast_ && ast_[sys-Coord::WCS]) ? ast_[sys-Coord::WCS] : NULL;} Vector wcsTran(AstFrameSet*, const Vector&, int); void wcsTran(AstFrameSet*, int, Vector*, int, Vector*); @@ -425,7 +428,6 @@ class FitsImage { void setWCSSkyFrame(AstFrameSet*, Coord::SkyFrame); void setWCSFormat(AstFrameSet*, int, const char*); #else - AstFrameSet* wcsCopy() {return (AstFrameSet*)astCopy(ast_);} Vector wcsTran(const Vector&, int); Vector3d wcsTran(const Vector3d&, int); void wcsTran(int num, Vector* in, int forward, Vector* out) diff --git a/tksao/frame/grid25d.C b/tksao/frame/grid25d.C index fbf0f28..6b46d1a 100644 --- a/tksao/frame/grid25d.C +++ b/tksao/frame/grid25d.C @@ -59,7 +59,7 @@ int Grid25d::doit(RenderMode rm) { // set desired skyformat #ifndef NEWWCS - AstFrameSet* ast = (AstFrameSet*)astCopy(fits->getAST(system_)); + AstFrameSet* ast = (AstFrameSet*)astCopy(fits->ast_[system_-Coord::WCS]); fits->setWCSSkyFrame(ast, sky_); #else if (!fits->astInv()) { @@ -68,7 +68,7 @@ int Grid25d::doit(RenderMode rm) } fits->setWCSSkyFrame(system_, sky_); - AstFrameSet* ast = fits->wcsCopy(); + AstFrameSet* ast = (AstFrameSet*)astCopy(fits->ast_); int naxes = astGetI(ast,"Naxes"); switch (naxes) { diff --git a/tksao/frame/grid2d.C b/tksao/frame/grid2d.C index f89917f..1b45ce3 100644 --- a/tksao/frame/grid2d.C +++ b/tksao/frame/grid2d.C @@ -60,7 +60,7 @@ int Grid2d::doit(RenderMode rm) // set desired skyformat #ifndef NEWWCS - AstFrameSet* ast = (AstFrameSet*)astCopy(fits->getAST(system_)); + AstFrameSet* ast = (AstFrameSet*)astCopy(fits->ast_[system_-Coord::WCS]); fits->setWCSSkyFrame(ast, sky_); #else if (!fits->astInv()) { @@ -69,7 +69,7 @@ int Grid2d::doit(RenderMode rm) } fits->setWCSSkyFrame(system_, sky_); - AstFrameSet* ast = fits->wcsCopy(); + AstFrameSet* ast = (AstFrameSet*)astCopy(fits->ast_); int naxes = astGetI(ast,"Naxes"); switch (naxes) { @@ -105,6 +105,7 @@ int Grid2d::doit(RenderMode rm) astInvert(ast); astAddFrame(frameSet, AST__CURRENT, astUnitMap(2,""), ast); astSetI(frameSet,"Current",id+nf); + astShow(frameSet); } break; } diff --git a/tksao/frame/grid3d.C b/tksao/frame/grid3d.C index 8db3f09..37a770e 100644 --- a/tksao/frame/grid3d.C +++ b/tksao/frame/grid3d.C @@ -83,7 +83,7 @@ int Grid3d::doit(RenderMode rm) #ifndef NEWWCS foobar = fits; - AstFrameSet* ast = (AstFrameSet*)astCopy(fits->getAST(system_)); + AstFrameSet* ast = (AstFrameSet*)astCopy(fits->ast_[system_-Coord::WCS]); fits->setWCSSkyFrame(ast, sky_); AstFrame* zbase = astFrame(1,""); @@ -114,7 +114,7 @@ int Grid3d::doit(RenderMode rm) } fits->setWCSSkyFrame(system_, sky_); - AstFrameSet* ast = fits->wcsCopy(); + AstFrameSet* ast = (AstFrameSet*)astCopy(fits->ast_); int naxes = astGetI(ast,"Naxes"); switch (naxes) { @@ -190,7 +190,6 @@ int Grid3d::doit(RenderMode rm) renderMode_ = rm; AstPlot3D* plot = astPlot3D(frameSet, gbox, pbox, option_); - // astShow(plot); astGrid(plot); astEnd; // now, clean up memory |