diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-08-10 19:22:10 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-08-10 19:22:10 (GMT) |
commit | f82e40472155ec329ecf6ecb96af54f22e39e2ba (patch) | |
tree | 44e8d9f2e644a7b66161f9cc30af1d0a5ff2b783 /tksao/frame/vect.C | |
parent | 93d29c498fef16baaebbf801d4025e0a1f5fccf3 (diff) | |
download | blt-f82e40472155ec329ecf6ecb96af54f22e39e2ba.zip blt-f82e40472155ec329ecf6ecb96af54f22e39e2ba.tar.gz blt-f82e40472155ec329ecf6ecb96af54f22e39e2ba.tar.bz2 |
simplify marker code
Diffstat (limited to 'tksao/frame/vect.C')
-rw-r--r-- | tksao/frame/vect.C | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/tksao/frame/vect.C b/tksao/frame/vect.C index 931180b..ea87b50 100644 --- a/tksao/frame/vect.C +++ b/tksao/frame/vect.C @@ -59,25 +59,32 @@ void Vect::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, FitsImage* ptr = parent->findFits(sys,center); listPre(str, sys, sky, ptr, strip, 1); + double rr = ptr->mapLenFromRef((p2-p1).length(),sys,Coord::ARCSEC); + double aa = parent->mapAngleFromRef((p2-p1).angle(),sys,sky); + switch (sys) { case Coord::IMAGE: case Coord::PHYSICAL: case Coord::DETECTOR: case Coord::AMPLIFIER: - listNonCel(ptr, str, sys); + { + Vector v1 = ptr->mapFromRef(p1,sys); + str << type_ << '(' << setprecision(parent->precLinear_) << v1 << ',' + << rr << ',' << radToDeg(aa) << ')'; + } break; default: + listWCS(ptr,p1,sys,sky,format); + str << type_ << '(' << ra << ',' << dec << ',' ; + if (ptr->hasWCSCel(sys)) { - listWCS(ptr,p1,sys,sky,format); - double rr = ptr->mapLenFromRef((p2-p1).length(),sys,Coord::ARCSEC); - double aa = parent->mapAngleFromRef((p2-p1).angle(),sys,sky); - str << type_ << '(' << ra << ',' << dec << ',' - << setprecision(parent->precArcsec_) << fixed << rr << '"' << ','; + str << setprecision(parent->precArcsec_) << fixed << rr << '"' << ','; str.unsetf(ios_base::floatfield); - str << setprecision(parent->precLinear_) << radToDeg(aa) << ')'; } else - listNonCel(ptr, str, sys); + str << setprecision(parent->precLinear_) << rr << ',' ; + + str << setprecision(parent->precLinear_) << radToDeg(aa) << ')'; } if (conj) @@ -88,15 +95,6 @@ void Vect::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, } } -void Vect::listNonCel(FitsImage* ptr, ostream& str, Coord::CoordSystem sys) -{ - Vector v1 = ptr->mapFromRef(p1,sys); - double rr = ptr->mapLenFromRef((p2-p1).length(),sys); - double aa = parent->mapAngleFromRef((p2-p1).angle(),sys); - str << type_ << '(' << setprecision(parent->precLinear_) << v1 << ',' - << rr << ',' << radToDeg(aa) << ')'; -} - void Vect::listXML(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format) { |