diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-08-12 20:05:50 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-08-12 20:05:50 (GMT) |
commit | d617d2936d32042585a571683ab86bb4ce51a4c1 (patch) | |
tree | cd30c0c77bc06c394be691774a9c908ccae7d9ee | |
parent | 39c2c6a9b4f156271ee72313e77eef2d2825bac9 (diff) | |
download | blt-d617d2936d32042585a571683ab86bb4ce51a4c1.zip blt-d617d2936d32042585a571683ab86bb4ce51a4c1.tar.gz blt-d617d2936d32042585a571683ab86bb4ce51a4c1.tar.bz2 |
update marker precision
-rw-r--r-- | tksao/frame/box.C | 65 | ||||
-rw-r--r-- | tksao/frame/circle.C | 61 | ||||
-rw-r--r-- | tksao/frame/ellipse.C | 67 | ||||
-rw-r--r-- | tksao/frame/line.C | 22 | ||||
-rw-r--r-- | tksao/frame/point.C | 14 | ||||
-rw-r--r-- | tksao/frame/polygon.C | 54 | ||||
-rw-r--r-- | tksao/frame/text.C | 17 |
7 files changed, 135 insertions, 165 deletions
diff --git a/tksao/frame/box.C b/tksao/frame/box.C index 3dee52f..d440157 100644 --- a/tksao/frame/box.C +++ b/tksao/frame/box.C @@ -359,39 +359,6 @@ void Box::listCiao(ostream& str, Coord::CoordSystem sys, int strip) listCiaoPost(str, strip); } -void Box::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, - Coord::SkyFormat format, int strip) -{ - FitsImage* ptr = parent->findFits(); - listSAOtngPre(str, strip); - - // radius is always in image coords - switch (sys) { - case Coord::IMAGE: - case Coord::PHYSICAL: - case Coord::DETECTOR: - case Coord::AMPLIFIER: - { - Vector vv = ptr->mapFromRef(center,Coord::IMAGE); - Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE); - str << type_ << '(' << setprecision(parent->precLinear_) << vv << ',' - << rr << ',' - << radToDeg(angle) << ')'; - } - break; - default: - if (ptr->hasWCSCel(sys)) { - listWCS(ptr,center,sys,sky,format); - Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE); - str << type_ << '(' << ra << ',' << dec << ',' - << setprecision(parent->precLinear_) << rr << ',' - << setprecision(parent->precLinear_) << radToDeg(angle) << ')'; - } - } - - listSAOtngPost(str,strip); -} - void Box::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format, int strip) { @@ -436,6 +403,38 @@ void Box::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, listProsPost(str, strip); } +void Box::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, + Coord::SkyFormat format, int strip) +{ + FitsImage* ptr = parent->findFits(); + listSAOtngPre(str, strip); + + str << type_ << '('; + switch (sys) { + case Coord::IMAGE: + case Coord::PHYSICAL: + case Coord::DETECTOR: + case Coord::AMPLIFIER: + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(center,Coord::IMAGE) << ',' + << setprecision(parent->precLenLinear_) + << ptr->mapLenFromRef(annuli_[0],Coord::IMAGE) << ',' + << setprecision(parent->precAngle_) + << radToDeg(angle); + break; + default: + listWCS(ptr,center,sys,sky,format); + str << ra << ',' << dec << ',' + << setprecision(parent->precLinear_) + << ptr->mapLenFromRef(annuli_[0],Coord::IMAGE) << ',' + << setprecision(parent->precAngle_) + << radToDeg(angle); + } + str << ')'; + + listSAOtngPost(str,strip); +} + void Box::listSAOimage(ostream& str, int strip) { FitsImage* ptr = parent->findFits(); diff --git a/tksao/frame/circle.C b/tksao/frame/circle.C index 46df25e..adbfbd4 100644 --- a/tksao/frame/circle.C +++ b/tksao/frame/circle.C @@ -308,38 +308,6 @@ void Circle::listCiao(ostream& str, Coord::CoordSystem sys, int strip) listCiaoPost(str, strip); } -void Circle::listSAOtng(ostream& str, - Coord::CoordSystem sys, Coord::SkyFrame sky, - Coord::SkyFormat format, int strip) -{ - FitsImage* ptr = parent->findFits(); - listSAOtngPre(str, strip); - - switch (sys) { - case Coord::IMAGE: - case Coord::PHYSICAL: - case Coord::DETECTOR: - case Coord::AMPLIFIER: - { - Vector vv = ptr->mapFromRef(center,Coord::IMAGE); - double rr = ptr->mapLenFromRef(annuli_[0][0],Coord::IMAGE); - str << type_ << '(' << setprecision(parent->precLinear_) << vv << ',' - << setprecision(parent->precLenLinear_) << rr << ')'; - } - break; - default: - if (ptr->hasWCSCel(sys)) { - listWCS(ptr,center,sys,sky,format); - double rr = ptr->mapLenFromRef(annuli_[0][0],Coord::IMAGE); - str << type_ << '(' - << ra << ',' << dec << ',' - << setprecision(parent->precLenLinear_) << rr << ')'; - } - } - - listSAOtngPost(str,strip); -} - void Circle::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format, int strip) { @@ -382,6 +350,35 @@ void Circle::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, listProsPost(str, strip); } +void Circle::listSAOtng(ostream& str, + Coord::CoordSystem sys, Coord::SkyFrame sky, + Coord::SkyFormat format, int strip) +{ + FitsImage* ptr = parent->findFits(); + listSAOtngPre(str, strip); + + str << type_ << '('; + switch (sys) { + case Coord::IMAGE: + case Coord::PHYSICAL: + case Coord::DETECTOR: + case Coord::AMPLIFIER: + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(center,Coord::IMAGE) << ',' + << setprecision(parent->precLenLinear_) + << ptr->mapLenFromRef(annuli_[0][0],Coord::IMAGE); + break; + default: + listWCS(ptr,center,sys,sky,format); + str << ra << ',' << dec << ',' + << setprecision(parent->precLenLinear_) + << ptr->mapLenFromRef(annuli_[0][0],Coord::IMAGE); + } + str << ')'; + + listSAOtngPost(str,strip); +} + void Circle::listSAOimage(ostream& str, int strip) { FitsImage* ptr = parent->findFits(); diff --git a/tksao/frame/ellipse.C b/tksao/frame/ellipse.C index 29a2f08..a1899c2 100644 --- a/tksao/frame/ellipse.C +++ b/tksao/frame/ellipse.C @@ -334,40 +334,6 @@ void Ellipse::listCiao(ostream& str, Coord::CoordSystem sys, int strip) listCiaoPost(str, strip); } -void Ellipse::listSAOtng(ostream& str, Coord::CoordSystem sys, - Coord::SkyFrame sky, Coord::SkyFormat format, - int strip) -{ - FitsImage* ptr = parent->findFits(); - listSAOtngPre(str, strip); - - // radius is always in image coords - - switch (sys) { - case Coord::IMAGE: - case Coord::PHYSICAL: - case Coord::DETECTOR: - case Coord::AMPLIFIER: - { - Vector vv = ptr->mapFromRef(center,Coord::IMAGE); - Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE); - str << type_ << '(' << setprecision(parent->precLinear_) << vv << ',' - << setprecision(parent->precLinear_) << rr << ','; - } - break; - default: - if (ptr->hasWCSCel(sys)) { - listWCS(ptr,center,sys,sky,format); - Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE); - str << type_ << '(' << ra << ',' << dec << ',' - << setprecision(parent->precLenLinear_) << rr << ','; - } - } - str << setprecision(parent->precAngle_) << radToDeg(angle) << ')'; - - listSAOtngPost(str, strip); -} - void Ellipse::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format, int strip) @@ -413,6 +379,39 @@ void Ellipse::listPros(ostream& str, Coord::CoordSystem sys, listProsPost(str, strip); } +void Ellipse::listSAOtng(ostream& str, Coord::CoordSystem sys, + Coord::SkyFrame sky, Coord::SkyFormat format, + int strip) +{ + FitsImage* ptr = parent->findFits(); + listSAOtngPre(str, strip); + + str << type_ << '('; + switch (sys) { + case Coord::IMAGE: + case Coord::PHYSICAL: + case Coord::DETECTOR: + case Coord::AMPLIFIER: + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(center,Coord::IMAGE) << ',' + << setprecision(parent->precLenLinear_) + << ptr->mapLenFromRef(annuli_[0],Coord::IMAGE) << ',' + << setprecision(parent->precAngle_) + << radToDeg(angle); + break; + default: + listWCS(ptr,center,sys,sky,format); + str << ra << ',' << dec << ',' + << setprecision(parent->precLenLinear_) + << ptr->mapLenFromRef(annuli_[0],Coord::IMAGE) << ',' + << setprecision(parent->precAngle_) + << radToDeg(angle); + } + str << ')'; + + listSAOtngPost(str, strip); +} + void Ellipse::listSAOimage(ostream& str, int strip) { FitsImage* ptr = parent->findFits(); diff --git a/tksao/frame/line.C b/tksao/frame/line.C index ad19d04..f6b4282 100644 --- a/tksao/frame/line.C +++ b/tksao/frame/line.C @@ -269,27 +269,23 @@ void Line::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, FitsImage* ptr = parent->findFits(); listSAOtngPre(str, strip); + str << type_ << '('; switch (sys) { case Coord::IMAGE: case Coord::PHYSICAL: case Coord::DETECTOR: case Coord::AMPLIFIER: - { - Vector v1 = ptr->mapFromRef(p1,Coord::IMAGE); - Vector v2 = ptr->mapFromRef(p2,Coord::IMAGE); - str << type_ << '(' << setprecision(parent->precLinear_) - << v1 << ',' << v2 << ')'; - } + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(p1,Coord::IMAGE) << ',' + << ptr->mapFromRef(p2,Coord::IMAGE); break; default: - if (ptr->hasWCSCel(sys)) { - str << type_ << '('; - listWCS(ptr,p1,sys,sky,format); - str << ra << ',' << dec << ','; - listWCS(ptr,p2,sys,sky,format); - str << ra << ',' << dec << ')'; - } + listWCS(ptr,p1,sys,sky,format); + str << ra << ',' << dec << ','; + listWCS(ptr,p2,sys,sky,format); + str << ra << ',' << dec; } + str<< ')'; listSAOtngPost(str, strip); } diff --git a/tksao/frame/point.C b/tksao/frame/point.C index 430acfd..ac8f712 100644 --- a/tksao/frame/point.C +++ b/tksao/frame/point.C @@ -878,22 +878,20 @@ void Point::listSAOtng(ostream& str, Coord::CoordSystem sys, FitsImage* ptr = parent->findFits(); listSAOtngPre(str, strip); + str << type_ << '('; switch (sys) { case Coord::IMAGE: case Coord::PHYSICAL: case Coord::DETECTOR: case Coord::AMPLIFIER: - { - Vector vv = ptr->mapFromRef(center,Coord::IMAGE); - str << type_ << '(' << setprecision(parent->precLinear_) << vv << ')'; - } + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(center,Coord::IMAGE); break; default: - if (ptr->hasWCSCel(sys)) { - listWCS(ptr,center,sys,sky,format); - str << type_ << '(' << ra << ',' << dec << ')'; - } + listWCS(ptr,center,sys,sky,format); + str << ra << ',' << dec; } + str << ')'; listSAOtngPost(str,strip); } diff --git a/tksao/frame/polygon.C b/tksao/frame/polygon.C index e09a454..91ff094 100644 --- a/tksao/frame/polygon.C +++ b/tksao/frame/polygon.C @@ -509,44 +509,28 @@ void Polygon::listSAOtng(ostream& str, Coord::CoordSystem sys, Matrix mm = fwdMatrix(); listSAOtngPre(str, strip); - switch (sys) { - case Coord::IMAGE: - case Coord::PHYSICAL: - case Coord::DETECTOR: - case Coord::AMPLIFIER: - { - str << type_ << '('; - int first=1; - vertex.head(); - do { - if (!first) - str << ','; - first=0; + str << type_ << '('; + int first=1; + vertex.head(); + do { + if (!first) + str << ','; + first=0; - Vector vv = ptr->mapFromRef(vertex.current()->vector*mm,sys); - str << setprecision(parent->precLinear_) << vv; - } - while (vertex.next()); - str << ')'; - } + switch (sys) { + case Coord::IMAGE: + case Coord::PHYSICAL: + case Coord::DETECTOR: + case Coord::AMPLIFIER: + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(vertex.current()->vector*mm,sys); break; - default: - if (ptr->hasWCSCel(sys)) { - str << type_ << '('; - int first=1; - vertex.head(); - do { - if (!first) - str << ','; - first=0; - - listWCS(ptr,vertex.current()->vector*mm,sys,sky,format); - str << ra << ',' << dec; - } - while (vertex.next()); - str << ')'; + default: + listWCS(ptr,vertex.current()->vector*mm,sys,sky,format); + str << ra << ',' << dec; } - } + } while (vertex.next()); + str << ')'; listSAOtngPost(str, strip); } diff --git a/tksao/frame/text.C b/tksao/frame/text.C index acc92c1..98cf86c 100644 --- a/tksao/frame/text.C +++ b/tksao/frame/text.C @@ -272,24 +272,21 @@ void Text::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky, else str << '-'; + str << type_ << '('; switch (sys) { case Coord::IMAGE: case Coord::PHYSICAL: case Coord::DETECTOR: case Coord::AMPLIFIER: - { - Vector vv = ptr->mapFromRef(center,Coord::IMAGE); - str << type_ << '(' << setprecision(parent->precLinear_) - << vv << ", \"" << text << "\")"; - } + str << setprecision(parent->precLinear_) + << ptr->mapFromRef(center,Coord::IMAGE) << ", \"" << text << "\""; break; default: - if (ptr->hasWCSCel(sys)) { - listWCS(ptr,center,sys,sky,format); - str << type_ << '(' << ra << ',' << dec << ", \"" << text << "\")"; - } + listWCS(ptr,center,sys,sky,format); + str << ra << ',' << dec << ", \"" << text << "\""; } - + str << ')'; + listSAOtngPost(str, strip); } |