From a18d63abab08e41fe439e13da46e1e686933e9c0 Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 3 Oct 2017 15:11:58 -0400 Subject: FITSY++: FITS compression- fixed issue with keyword ZNAXIS3=0 --- ds9/doc/release/r7.6.html | 2 ++ tksao/fitsy++/compress.C | 2 ++ tksao/frame/frsave.C | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/ds9/doc/release/r7.6.html b/ds9/doc/release/r7.6.html index 5cf34bf..be89ae6 100644 --- a/ds9/doc/release/r7.6.html +++ b/ds9/doc/release/r7.6.html @@ -145,6 +145,8 @@
  • 09.25.2017 XPA: rm checkdns from init sequence
  • 09.29.2017 WCS: fixed a problem with use of PC keywords, with CDELT = 1.
  • 10.01.2017 RELEASE version 7.6b6
  • +
  • 09.29.2017 FITSY++: FITS compresssion- fixed a problem with ZNAXIS3=0 keyword issue.
  • +
  • xx.xx.2017 RELEASE version 7.6b7
  • diff --git a/tksao/fitsy++/compress.C b/tksao/fitsy++/compress.C index 96d7715..37d16c2 100644 --- a/tksao/fitsy++/compress.C +++ b/tksao/fitsy++/compress.C @@ -15,6 +15,8 @@ FitsCompress::FitsCompress(FitsFile* fits) width_ = fits->getInteger("ZNAXIS1",0); height_ = fits->getInteger("ZNAXIS2",0); depth_ = fits->getInteger("ZNAXIS3",1); + if (depth_<1) + depth_ =1; ww_ = fits->getInteger("ZTILE1",width_); hh_ = fits->getInteger("ZTILE2",1); dd_ = fits->getInteger("ZTILE3",1); diff --git a/tksao/frame/frsave.C b/tksao/frame/frsave.C index 791d31c..21406a5 100644 --- a/tksao/frame/frsave.C +++ b/tksao/frame/frsave.C @@ -446,6 +446,7 @@ void FrameBase::saveFitsResampleKeyword(OutFitsStream& str, FitsHead& dst) // WCS if (currentContext->fits->hasWCS(Coord::WCS)) { +#ifndef NEWWCS WorldCoor* wcs = currentContext->fits->getWCS(Coord::WCS); // abort if this is a DSS, ZPN, TNX @@ -503,6 +504,26 @@ void FrameBase::saveFitsResampleKeyword(OutFitsStream& str, FitsHead& dst) dst.appendReal("CD1_2", cd.matrix(0,1), 9, NULL); dst.appendReal("CD2_1", cd.matrix(1,0), 9, NULL); dst.appendReal("CD2_2", cd.matrix(1,1), 9, NULL); +#else + + if (src->find("RADESYS")) + dst.appendString("RADESYS", src->getString("RADESYS"), NULL); + if (src->find("EQUINOX")) + dst.appendReal("EQUINOX", src->getReal("EQUINOX",2000), 9, NULL); + if (src->find("CTYPE1")) + dst.appendString("CTYPE1", src->getString("CTYPE1"), NULL); + if (src->find("CTYPE2")) + dst.appendString("CTYPE2", src->getString("CTYPE2"), NULL); + if (src->find("CRVAL1")) + dst.appendReal("CRVAL1", src->getReal("CRVAL1",1), 9, NULL); + if (src->find("CRVAL2")) + dst.appendReal("CRVAL2", src->getReal("CRVAL2",1), 9, NULL); + if (src->find("CUNIT1")) + dst.appendString("CUNIT1", src->getString("CUNIT1"), NULL); + if (src->find("CUNIT2")) + dst.appendString("CUNIT2", src->getString("CUNIT2"), NULL); + +#endif } } -- cgit v0.12