From 1426a5fd1196e30b8e2eecbf01e34e36a787e287 Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 26 Jul 2018 12:30:23 -0400 Subject: clean up code --- tksao/frame/fitsimage.C | 21 ++++++++++++++++----- tksao/frame/fitsimage.h | 1 + 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 8603347..5e98a39 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -128,6 +128,7 @@ FitsImage::FitsImage(Context* cx, Tcl_Interp* pp) #endif wcsAltHeader_ =NULL; wfpc2Header_ =NULL; + wcs0Header_ =NULL; iisMode_ =0; iiszt_ =0; @@ -220,6 +221,8 @@ FitsImage::~FitsImage() delete wcsAltHeader_; if (wfpc2Header_) delete wfpc2Header_; + if (wcs0Header_) + delete wcs0Header_; } // Fits @@ -1019,6 +1022,8 @@ char* FitsImage::displayWCS() return display(wcsAltHeader_); else if (wfpc2Header_) return display(wfpc2Header_); + else if (wcs0Header_) + return display(wcs0Header_); else return display(image_->head()); } @@ -1337,16 +1342,22 @@ void FitsImage::resetWCS() delete [] objectKeyword_; objectKeyword_ = dupstr(image_->getString("OBJECT")); - // Process WCS keywords if (wcsAltHeader_) delete wcsAltHeader_; + wcsAltHeader_ =NULL; + + if (wcs0Header_) + delete wcs0Header_; + wcs0Header_ =NULL; - wcsAltHeader_ = NULL; + if (wfpc2Header_) + initWCS(wfpc2Header_); + else #ifdef OLDWCS - initWCS(image_->head(), - image_->primary() && image_->inherit() ? image_->primary() : NULL); + initWCS(image_->head(), + image_->primary() && image_->inherit() ? image_->primary() : NULL); #else - initWCS(image_->head()); + initWCS(image_->head()); #endif } diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h index 2f544fe..6d778a1 100644 --- a/tksao/frame/fitsimage.h +++ b/tksao/frame/fitsimage.h @@ -131,6 +131,7 @@ class FitsImage { #endif FitsHead* wcsAltHeader_; // alt wcs header FitsHead* wfpc2Header_; // wcs header for wfpc2 + FitsHead* wcs0Header_; Matrix wcsToRef_; // iraf/wcs matrix -- cgit v0.12