From c4f4ab752da20d5144273a201a382bf37e515e17 Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 17 Jul 2018 11:40:09 -0400 Subject: clean up code --- tksao/frame/fitsimage.C | 36 +++++++----------------------------- tksao/frame/fitsimage.h | 2 +- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 2db98ad..cf02ea2 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -932,7 +932,7 @@ void FitsImage::altWCS(istream& str) delete altHeader_; altHeader_ = hh; - initWCS(); + initWCS(altHeader_, NULL); } void FitsImage::appendWCS(istream& str) @@ -972,7 +972,7 @@ void FitsImage::appendWCS(istream& str) delete wcsHeader_; wcsHeader_ = new FitsHead(cards,ll,FitsHead::ALLOC); - initWCS(); + initWCS(wcsHeader_, NULL); } char* FitsImage::display(FitsHead* hd) @@ -1071,7 +1071,7 @@ void FitsImage::iisSetFileName(const char* fn) } #ifndef NEWWCS -void FitsImage::initWCS() +void FitsImage::initWCS(FitsHead* hd, FitsHead* prim) { if (wcs_) { for (int ii=0; iihead(); - prim = image_->primary() && image_->inherit() ? image_->primary() : NULL; - } - // wcsinit is sloooowwww! so try to figure it out first // look first for default WCS. Let wcsinit figure it out since there can // be many different non-standard wcs's present @@ -1275,7 +1263,7 @@ void FitsImage::initWCS() #else -void FitsImage::initWCS() +void FitsImage::initWCS(FitsHead* hd, FitsHead* prim) { if (manageWCS_) { if (ast_) @@ -1327,17 +1315,6 @@ void FitsImage::initWCS() } } - FitsHead* hd =NULL; - FitsHead* prim =NULL; - if (wcsHeader_) - hd = wcsHeader_; - else if (altHeader_) - hd = altHeader_; - else { - hd = image_->head(); - prim = image_->primary() && image_->inherit() ? image_->primary() : NULL; - } - astInit(hd, prim); wcsInit(); wcsEquInit(); @@ -2322,7 +2299,7 @@ void FitsImage::replaceWCS(istream& str) delete wcsHeader_; wcsHeader_ = hh; - initWCS(); + initWCS(wcsHeader_, NULL); } void FitsImage::reset() @@ -2382,7 +2359,8 @@ void FitsImage::resetWCS() delete wcsHeader_; wcsHeader_ = NULL; - initWCS(); + initWCS(image_->head(), + image_->primary() && image_->inherit() ? image_->primary() : NULL); } #ifndef NEWWCS diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h index 9451e81..ab63aa3 100644 --- a/tksao/frame/fitsimage.h +++ b/tksao/frame/fitsimage.h @@ -150,7 +150,7 @@ class FitsImage { void initBin(); void initHPX(); - void initWCS(); + void initWCS(FitsHead*, FitsHead*); #ifndef NEWWCS void initWCSPhysical(); void wcsShow(WorldCoor*); -- cgit v0.12