summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-07-26 16:30:23 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-07-26 16:30:23 (GMT)
commit1426a5fd1196e30b8e2eecbf01e34e36a787e287 (patch)
tree9a702fbe9cf3246e481aa54a3bacc18d29a236dd
parentfb51570ed742e395a67beabb7d64d878dff2181a (diff)
downloadblt-1426a5fd1196e30b8e2eecbf01e34e36a787e287.zip
blt-1426a5fd1196e30b8e2eecbf01e34e36a787e287.tar.gz
blt-1426a5fd1196e30b8e2eecbf01e34e36a787e287.tar.bz2
clean up code
-rw-r--r--tksao/frame/fitsimage.C21
-rw-r--r--tksao/frame/fitsimage.h1
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