summaryrefslogtreecommitdiffstats
path: root/tksao/frame
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-05-05 15:46:14 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-05-05 15:46:14 (GMT)
commit9ec6e3feb91635a1c1d89203c37aac0b6f91331e (patch)
treef52ba976739d367d81a59d0852c44539c793cf42 /tksao/frame
parent28016fa5ea336bad89856ed323942c927ba4a05b (diff)
downloadblt-9ec6e3feb91635a1c1d89203c37aac0b6f91331e.zip
blt-9ec6e3feb91635a1c1d89203c37aac0b6f91331e.tar.gz
blt-9ec6e3feb91635a1c1d89203c37aac0b6f91331e.tar.bz2
simplify wcs2ast CTYPE
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/fitsimage.C48
1 files changed, 16 insertions, 32 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C
index 409368d..97576bf 100644
--- a/tksao/frame/fitsimage.C
+++ b/tksao/frame/fitsimage.C
@@ -3605,22 +3605,22 @@ void FitsImage::wcs2ast(int ww, FitsHead* hd, FitsHead* prim, void* chan)
// CTYPE
if (
// special case (reorder 3D cube)
- (!strncmp(wcs_[ww]->c1type,"GLON",4) &&
- strncmp(wcs_[ww]->c2type,"GLAT",4)) ||
- (strncmp(wcs_[ww]->c1type,"GLON",4) &&
- !strncmp(wcs_[ww]->c2type,"GLAT",4)) ||
- (!strncmp(wcs_[ww]->c1type,"GLAT",4) &&
- strncmp(wcs_[ww]->c2type,"GLON",4)) ||
- (strncmp(wcs_[ww]->c1type,"GLAT",4) &&
- !strncmp(wcs_[ww]->c2type,"GLON",4)) ||
- (!strncmp(wcs_[ww]->c1type,"RA",2) &&
- strncmp(wcs_[ww]->c2type,"DEC",3)) ||
- (strncmp(wcs_[ww]->c1type,"RA",2) &&
- !strncmp(wcs_[ww]->c2type,"DEC",3)) ||
- (!strncmp(wcs_[ww]->c1type,"DEC",3) &&
- strncmp(wcs_[ww]->c2type,"RA",2)) ||
- (strncmp(wcs_[ww]->c1type,"DEC",3) &&
- !strncmp(wcs_[ww]->c2type,"RA",2)))
+ (!strncmp(wcs_[ww]->ctype[0],"GLON",4) &&
+ strncmp(wcs_[ww]->ctype[1],"GLAT",4)) ||
+ (strncmp(wcs_[ww]->ctype[0],"GLON",4) &&
+ !strncmp(wcs_[ww]->ctype[1],"GLAT",4)) ||
+ (!strncmp(wcs_[ww]->ctype[0],"GLAT",4) &&
+ strncmp(wcs_[ww]->ctype[1],"GLON",4)) ||
+ (strncmp(wcs_[ww]->ctype[0],"GLAT",4) &&
+ !strncmp(wcs_[ww]->ctype[1],"GLON",4)) ||
+ (!strncmp(wcs_[ww]->ctype[0],"RA",2) &&
+ strncmp(wcs_[ww]->ctype[1],"DEC",3)) ||
+ (strncmp(wcs_[ww]->ctype[0],"RA",2) &&
+ !strncmp(wcs_[ww]->ctype[1],"DEC",3)) ||
+ (!strncmp(wcs_[ww]->ctype[0],"DEC",3) &&
+ strncmp(wcs_[ww]->ctype[1],"RA",2)) ||
+ (strncmp(wcs_[ww]->ctype[0],"DEC",3) &&
+ !strncmp(wcs_[ww]->ctype[1],"RA",2)))
{
putFitsCard(chan, "CTYPE1", "LINEAR");
putFitsCard(chan, "CTYPE2", "LINEAR");
@@ -3638,22 +3638,6 @@ void FitsImage::wcs2ast(int ww, FitsHead* hd, FitsHead* prim, void* chan)
putFitsCard(chan, "CTYPE2", str.str().c_str());
}
}
- else if ((wcs_[ww]->prjcode == WCS_LIN) &&
- (strncmp(wcs_[ww]->ctype[0]+2,"LN",2)) &&
- (strncmp(wcs_[ww]->ctype[0]+2,"LT",2)) &&
- (strncmp(wcs_[ww]->ctype[0]+1,"LON",3)) &&
- (strncmp(wcs_[ww]->ctype[0]+1,"LAT",3)) &&
- (*wcs_[ww]->c1type && *wcs_[ww]->c2type)) {
- // this is not a mistake
- putFitsCard(chan, "CTYPE1", wcs_[ww]->c1type);
- putFitsCard(chan, "CTYPE2", wcs_[ww]->c2type);
- }
- else if ((wcs_[ww]->prjcode == WCS_PIX) &&
- (*wcs_[ww]->c1type && *wcs_[ww]->c2type)) {
- // this is not a mistake
- putFitsCard(chan, "CTYPE1", wcs_[ww]->c1type);
- putFitsCard(chan, "CTYPE2", wcs_[ww]->c2type);
- }
else {
putFitsCard(chan, "CTYPE1", wcs_[ww]->ctype[0]);
putFitsCard(chan, "CTYPE2", wcs_[ww]->ctype[1]);