summaryrefslogtreecommitdiffstats
path: root/tksao/frame
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-08-14 20:42:52 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-08-14 20:42:52 (GMT)
commit07a1273568154392b3fca0d27694c9f0e98e39a4 (patch)
tree88f9b753e2569189d58aca9d206dc4c0b8401b55 /tksao/frame
parente3bfa1c0537d69262c65429c0d40d1e3cec8338d (diff)
downloadblt-07a1273568154392b3fca0d27694c9f0e98e39a4.zip
blt-07a1273568154392b3fca0d27694c9f0e98e39a4.tar.gz
blt-07a1273568154392b3fca0d27694c9f0e98e39a4.tar.bz2
simplify marker code
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/box.C103
-rw-r--r--tksao/frame/ellipse.C82
2 files changed, 82 insertions, 103 deletions
diff --git a/tksao/frame/box.C b/tksao/frame/box.C
index 208c671..197dd0e 100644
--- a/tksao/frame/box.C
+++ b/tksao/frame/box.C
@@ -262,9 +262,6 @@ void Box::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
FitsImage* ptr = parent->findFits(sys,center);
listPre(str, sys, sky, ptr, strip, 0);
- Vector rr = ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCSEC);
- double aa = parent->mapAngleFromRef(angle,sys,sky);
-
str << type_ << '(';
switch (sys) {
case Coord::IMAGE:
@@ -275,20 +272,16 @@ void Box::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
str << ',';
ptr->listLenFromRef(str,annuli_[0],sys);
str << ',';
- parent->listAngleFromRef(str,angle,sys,sky);
+ parent->listAngleFromRef(str,angle,sys);
break;
default:
- listWCS(ptr,center,sys,sky,format);
- str << ra << ',' << dec << ',' ;
-
- if (ptr->hasWCSCel(sys)) {
- str << setprecision(parent->precArcsec_) << fixed << setunit('"')
- << rr << ',';
- str.unsetf(ios_base::floatfield);
- }
- else
- str << setprecision(parent->precLenLinear_) << rr << ',' ;
- str << setprecision(parent->precAngle_) << radToDeg(aa);
+ ptr->listFromRef(str,center,sys,sky,format);
+ str << ',';
+ if (ptr->hasWCSCel(sys))
+ str << setunit('"');
+ ptr->listLenFromRef(str,annuli_[0],sys,Coord::ARCSEC);
+ str << ',';
+ parent->listAngleFromRef(str,angle,sys,sky);
}
str << ')';
@@ -344,20 +337,22 @@ void Box::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
case Coord::PHYSICAL:
case Coord::DETECTOR:
case Coord::AMPLIFIER:
- str << setprecision(parent->precLinear_)
- << ptr->mapFromRef(center,Coord::PHYSICAL) << ','
- << setprecision(parent->precLenLinear_)
- << ptr->mapLenFromRef(annuli_[0],Coord::PHYSICAL) << ',';
+ ptr->listFromRef(str,center,Coord::PHYSICAL);
+ str << ',';
+ ptr->listLenFromRef(str,annuli_[0],Coord::PHYSICAL);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::PHYSICAL);
break;
default:
- listWCS(ptr,center,sys,Coord::FK5,Coord::SEXAGESIMAL);
- str << ra << ',' << dec << ',';
-
- str << setprecision(parent->precArcmin_) << fixed << setunit('\'')
- << ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCMIN) << ',';
- str.unsetf(ios_base::floatfield);
+ ptr->listFromRef(str,center,sys,Coord::FK5,Coord::SEXAGESIMAL);
+ str << ',';
+ if (ptr->hasWCSCel(sys))
+ str << setunit('\'');
+ ptr->listLenFromRef(str,annuli_[0],sys,Coord::ARCMIN);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::PHYSICAL,Coord::FK5);
}
- str << setprecision(parent->precAngle_) << radToDeg(angle) << ')';
+ str << ')';
listCiaoPost(str, strip);
}
@@ -375,28 +370,21 @@ void Box::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
case Coord::AMPLIFIER:
sys = Coord::IMAGE;
case Coord::PHYSICAL:
- str << setprecision(parent->precLinear_)
- << ptr->mapFromRef(center,sys) << ' '
- << setprecision(parent->precLenLinear_)
- << ptr->mapLenFromRef(annuli_[0],Coord::IMAGE) << ' '
- << setprecision(parent->precAngle_)
- << radToDeg(angle);
+ ptr->listFromRef(str,center,sys);
+ str << ' ';
+ ptr->listLenFromRef(str,annuli_[0],Coord::IMAGE);
+ str << ' ';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
break;
default:
- listWCSPros(ptr,center,sys,sky,format);
- switch (format) {
- case Coord::DEGREES:
- str << ra << 'd' << ' ' << dec << 'd' << ' ';
- break;
- case Coord::SEXAGESIMAL:
- str << ra << ' ' << dec << ' ';
- break;
- }
- str << setprecision(parent->precArcsec_) << fixed << setunit('"')
- << ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCSEC) << ' ';
- str.unsetf(ios_base::floatfield);
- str << setprecision(parent->precAngle_)
- << radToDeg(angle);
+ if (format == Coord::DEGREES)
+ str << setunit('d');
+ ptr->listFromRef(str,center,sys,sky,format);
+ str << ' ';
+ str << setunit('"');
+ ptr->listLenFromRef(str,annuli_[0],sys,Coord::ARCSEC);
+ str << ' ';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
}
listProsPost(str, strip);
@@ -414,20 +402,19 @@ void Box::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
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);
+ ptr->listFromRef(str,center,Coord::IMAGE);
+ str << ',';
+ ptr->listLenFromRef(str,annuli_[0],Coord::IMAGE);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
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);
+ ptr->listFromRef(str,center,sys,sky,format);
+ str << ',';
+ ptr->listLenFromRef(str,annuli_[0],Coord::IMAGE);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
+ break;
}
str << ')';
diff --git a/tksao/frame/ellipse.C b/tksao/frame/ellipse.C
index 5a4bb31..5da3a29 100644
--- a/tksao/frame/ellipse.C
+++ b/tksao/frame/ellipse.C
@@ -249,8 +249,7 @@ void Ellipse::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
parent->listAngleFromRef(str,angle,sys,sky);
break;
default:
- listWCS(ptr,center,sys,sky,format);
- str << ra << ',' << dec;
+ ptr->listFromRef(str,center,sys,sky,format);
str << ',';
if (ptr->hasWCSCel(sys))
str << setunit('"');
@@ -312,21 +311,23 @@ void Ellipse::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
case Coord::PHYSICAL:
case Coord::DETECTOR:
case Coord::AMPLIFIER:
- str << setprecision(parent->precLinear_)
- << ptr->mapFromRef(center,Coord::PHYSICAL) << ','
- << setprecision(parent->precLenLinear_)
- << ptr->mapLenFromRef(annuli_[0],Coord::PHYSICAL) << ',';
+ ptr->listFromRef(str,center,Coord::PHYSICAL);
+ str << ',';
+ ptr->listLenFromRef(str,annuli_[0],Coord::PHYSICAL);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::PHYSICAL);
break;
default:
- listWCS(ptr,center,sys,Coord::FK5,Coord::SEXAGESIMAL);
- str << ra << ',' << dec << ',' ;
-
- str<< setprecision(parent->precArcmin_) << fixed << setunit('\'')
- << ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCMIN) << ',';
- str.unsetf(ios_base::floatfield);
+ ptr->listFromRef(str,center,sys,Coord::FK5,Coord::SEXAGESIMAL);
+ str << ',';
+ if (ptr->hasWCSCel(sys))
+ str << setunit('\'');
+ ptr->listLenFromRef(str,annuli_[0],sys,Coord::ARCMIN);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::PHYSICAL,Coord::FK5);
break;
}
- str << setprecision(parent->precAngle_) << radToDeg(angle) << ')';
+ str << ')';
listCiaoPost(str, strip);
}
@@ -345,28 +346,21 @@ void Ellipse::listPros(ostream& str, Coord::CoordSystem sys,
case Coord::AMPLIFIER:
sys = Coord::IMAGE;
case Coord::PHYSICAL:
- str << setprecision(parent->precLinear_)
- << ptr->mapFromRef(center,sys) << ' '
- << setprecision(parent->precLenLinear_)
- << ptr->mapLenFromRef(annuli_[0],Coord::IMAGE) << ' '
- << setprecision(parent->precAngle_)
- << radToDeg(angle);
+ ptr->listFromRef(str,center,sys);
+ str << ' ';
+ ptr->listLenFromRef(str,annuli_[0],Coord::IMAGE);
+ str << ' ';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
break;
default:
- listWCSPros(ptr,center,sys,sky,format);
- switch (format) {
- case Coord::DEGREES:
- str << ra << 'd' << ' ' << dec << 'd' << ' ';
- break;
- case Coord::SEXAGESIMAL:
- str << ra << ' ' << dec << ' ';
- break;
- }
- str << setprecision(parent->precArcsec_) << fixed << setunit('"')
- << ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCSEC) << ' ';
- str.unsetf(ios_base::floatfield);
- str << setprecision(parent->precAngle_)
- << radToDeg(angle);
+ if (format == Coord::DEGREES)
+ str << setunit('d');
+ ptr->listFromRef(str,center,sys,sky,format);
+ str << ' ';
+ str << setunit('"');
+ ptr->listLenFromRef(str,annuli_[0],sys,Coord::ARCSEC);
+ str << ' ';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
}
listProsPost(str, strip);
@@ -385,20 +379,18 @@ void Ellipse::listSAOtng(ostream& str, Coord::CoordSystem sys,
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);
+ ptr->listFromRef(str,center,Coord::IMAGE);
+ str << ',';
+ ptr->listLenFromRef(str,annuli_[0],Coord::IMAGE);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
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);
+ ptr->listFromRef(str,center,sys,sky,format);
+ str << ',';
+ ptr->listLenFromRef(str,annuli_[0],Coord::IMAGE);
+ str << ',';
+ parent->listAngleFromRef(str,angle,Coord::IMAGE);
}
str << ')';