diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-11-29 21:03:24 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-11-29 21:03:24 (GMT) |
commit | 218bcc3293086d26d4b822cfb4a1b11237759a08 (patch) | |
tree | 916141c1e956754f15159a6285dc1d270a50b968 /tksao/frame | |
parent | 71de900004e273c1e4241b6f85c2c430bc9d1343 (diff) | |
download | blt-218bcc3293086d26d4b822cfb4a1b11237759a08.zip blt-218bcc3293086d26d4b822cfb4a1b11237759a08.tar.gz blt-218bcc3293086d26d4b822cfb4a1b11237759a08.tar.bz2 |
update AST WCS
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/fitsimage.C | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index cdb6f80..49eb5df 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -3566,8 +3566,30 @@ double FitsImage::wcs2pixx(double in, Coord::CoordSystem sys, int aa) int FitsImage::hasWCS3D(Coord::CoordSystem sys, int aa) { + if (!newast_ || sys<Coord::WCS) + return 0; + + astClearStatus; + astBegin; + int ss = sys-Coord::WCS; - return (aa>=2&&aa<FTY_MAXAXES && sys>=Coord::WCS && wcsx_[ss]) ? 1 : 0; + int nn = astGetI(newast_,"nframe"); + char cc = ' '; + if (ss) + cc = ss+'@'; + + for (int ii=0; ii<nn; ii++) { + AstFrame* ff = (AstFrame*)astGetFrame(newast_,ii+1); + const char* id = astGetC(ff,"Ident"); + if (cc == id[0]) { + int naxes = astGetI(ff, "Naxes"); + astEnd; // now, clean up memory + return naxes>2 ? 1:0; + } + } + + astEnd; // now, clean up memory + return 0; } double FitsImage::pix2wcsx(double in, Coord::CoordSystem sys, int aa) |