From ddf4f1207d7a299ba642f5226b90e168fa0628b4 Mon Sep 17 00:00:00 2001 From: William Joye Date: Mon, 24 Sep 2018 11:39:06 -0400 Subject: BIN: use old style Einstein WCS keywords if present --- ds9/doc/release/r8.0.html | 1 + tksao/fitsy++/hist.C | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/ds9/doc/release/r8.0.html b/ds9/doc/release/r8.0.html index e5a4b44..7aa693e 100644 --- a/ds9/doc/release/r8.0.html +++ b/ds9/doc/release/r8.0.html @@ -80,6 +80,7 @@ incorrectly calculating an index into the data cube.
  • 09.21.2018 GUI: use unicode for deg symbol in infobox, previous char caused conflicts with Chinese Language.
  • 09.21.2018 AST: updated to version 8.6.3.
  • 09.21.2018 TKBLT: updated to version 3.2.11.
  • +
  • 09.24.2018 BIN: use old style Einstein WCS keywords if present.
  • 09.25.2018 RELEASE version 8.0rc3
  • diff --git a/tksao/fitsy++/hist.C b/tksao/fitsy++/hist.C index 39a1d16..c9eec73 100644 --- a/tksao/fitsy++/hist.C +++ b/tksao/fitsy++/hist.C @@ -633,6 +633,69 @@ void FitsHist::initWCS(FitsFile* fits, Matrix& mm, Vector block) if (!head_->find("RADESYS")) mapWCSString(srcHead, w, "RADESYS", "RADE"); } + + // and finally, check for old Einstein type WCS + char key[8]; + + // CTYPEx + strcpy(key,"CTYPE1"); + if (srcHead->find(key)) { + char* str = srcHead->getString(key); + head_->appendString(key, str, NULL); + } + strcpy(key,"CTYPE2"); + if (srcHead->find(key)) { + char* str = srcHead->getString(key); + head_->appendString(key, str, NULL); + } + + // CRVALx + strcpy(key,"CRVAL1"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + strcpy(key,key); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + + //CRPIXx + strcpy(key,"CRPIX1"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + strcpy(key,"CRPIX2"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + + // CDELTx + strcpy(key,"CDELT1"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + strcpy(key,"CDELT2"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + + // CROTAx + strcpy(key,"CROTA1"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } + strcpy(key,"CROTA2"); + if (srcHead->find(key)) { + float cc = srcHead->getReal(key, 0); + head_->appendReal(key, cc, 10, NULL); + } } FitsHistNext::FitsHistNext(FitsFile* prev) -- cgit v0.12