/Parser/

='id' value='a38fd423435acb45ac17f753578632e41824dec3'/>
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-01-11 22:25:33 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-01-11 22:25:33 (GMT)
commita38fd423435acb45ac17f753578632e41824dec3 (patch)
tree54cc1ef3e11baed58732a837d8663a2e2ba6080a /tksao/frame
parent6039bd516353b04936a9e22ea7f6cdb8bfbf1795 (diff)
downloadblt-a38fd423435acb45ac17f753578632e41824dec3.zip
blt-a38fd423435acb45ac17f753578632e41824dec3.tar.gz
blt-a38fd423435acb45ac17f753578632e41824dec3.tar.bz2
update precision
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/annulus.C14
-rw-r--r--tksao/frame/base.C9
-rw-r--r--tksao/frame/base.h7
-rw-r--r--tksao/frame/basecommand.C6
-rw-r--r--tksao/frame/baseline.C3
-rw-r--r--tksao/frame/basepolygon.C2
-rw-r--r--tksao/frame/box.C36
-rw-r--r--tksao/frame/boxannulus.C23
-rw-r--r--tksao/frame/bpanda.C27
-rw-r--r--tksao/frame/circle.C23
-rw-r--r--tksao/frame/compass.C5
-rw-r--r--tksao/frame/composite.C6
-rw-r--r--tksao/frame/context.h2
-rw-r--r--tksao/frame/cpanda.C26
-rw-r--r--tksao/frame/ellipse.C34
-rw-r--r--tksao/frame/ellipseannulus.C26
-rw-r--r--tksao/frame/epanda.C29
-rw-r--r--tksao/frame/fitsimage.C57
-rw-r--r--tksao/frame/fitsmap.C39
-rw-r--r--tksao/frame/line.C3
-rw-r--r--tksao/frame/marker.C8
-rw-r--r--tksao/frame/point.C10
-rw-r--r--tksao/frame/polygon.C8
-rw-r--r--tksao/frame/projection.C5
-rw-r--r--tksao/frame/text.C5
-rw-r--r--tksao/frame/vect.C6
26 files changed, 250 insertions, 169 deletions
diff --git a/tksao/frame/annulus.C b/tksao/frame/annulus.C
index c72f744..9b7aad3 100644
--- a/tksao/frame/annulus.C
+++ b/tksao/frame/annulus.C
@@ -215,7 +215,7 @@ void Annulus::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
if (ptr->hasWCSCel(sys)) {
listRADEC(ptr,center,sys,sky,format);
str << type_ << '(' << ra << ',' << dec
- << setprecision(3) << fixed;
+ << setprecision(parent->precArcsec) << fixed;
for (int ii=0; ii<numAnnuli_; ii++) {
double rr = ptr->mapLenFromRef(annuli_[ii][0],sys,Coord::ARCSEC);
str << ',' << rr << '"';
@@ -233,7 +233,7 @@ void Annulus::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
void Annulus::listNonCel(FitsImage* ptr, ostream& str, Coord::CoordSystem sys)
{
Vector vv = ptr->mapFromRef(center,sys);
- str << type_ << '(' << setprecision(8) << vv;
+ str << type_ << '(' << setprecision(parent->precLinear) << vv;
for (int ii=0; ii<numAnnuli_; ii++) {
double rr = ptr->mapLenFromRef(annuli_[ii][0],sys);
str << ',' << rr;
@@ -269,7 +269,7 @@ void Annulus::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
Vector vv = ptr->mapFromRef(center,Coord::PHYSICAL);
for (int ii=0; ii<numAnnuli_-1; ii++) {
listCiaoPre(str);
- str << type_ << '(' << setprecision(8) << vv << ','
+ str << type_ << '(' << setprecision(parent->precLinear) << vv << ','
<< ptr->mapLenFromRef(annuli_[ii][0],Coord::PHYSICAL) << ','
<< ptr->mapLenFromRef(annuli_[ii+1][0],Coord::PHYSICAL) << ')';
listCiaoPost(str, strip);
@@ -284,7 +284,7 @@ void Annulus::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
double r1 = ptr->mapLenFromRef(annuli_[ii][0],sys,Coord::ARCMIN);
double r2 = ptr->mapLenFromRef(annuli_[ii+1][0],sys,Coord::ARCMIN);
str << type_ << '(' << ra << ',' << dec << ','
- << setprecision(5) << fixed
+ << setprecision(parent->precArcmin) << fixed
<< r1 << '\'' << ',' << r2 << '\''
<< ')';
str.unsetf(ios_base::floatfield);
@@ -309,7 +309,7 @@ void Annulus::listPros(ostream& str, Coord::CoordSystem sys,
{
Vector vv = ptr->mapFromRef(center,sys);
coord.listProsCoordSystem(str,sys,sky);
- str << "; " << type_ << ' ' << setprecision(8) << vv;
+ str << "; " << type_ << ' ' << setprecision(parent->precLinear) << vv;
for (int ii=0; ii<numAnnuli_; ii++) {
double rr = ptr->mapLenFromRef(annuli_[ii][0],Coord::IMAGE);
str << ' ' << rr;
@@ -329,7 +329,7 @@ void Annulus::listPros(ostream& str, Coord::CoordSystem sys,
str << ra << ' ' << dec;
break;
}
- str << setprecision(3) << fixed;
+ str << setprecision(parent->precArcsec) << fixed;
for (int ii=0; ii<numAnnuli_; ii++) {
double rr = ptr->mapLenFromRef(annuli_[ii][0],sys,Coord::ARCSEC);
str << ' ' << rr << '"';
@@ -347,7 +347,7 @@ void Annulus::listSAOimage(ostream& str, int strip)
listSAOimagePre(str);
Vector vv = ptr->mapFromRef(center,Coord::IMAGE);
- str << type_ << '(' << setprecision(8) << vv;
+ str << type_ << '(' << setprecision(parent->precLinear) << vv;
for (int ii=0; ii<numAnnuli_; ii++) {
double rr = ptr->mapLenFromRef(annuli_[ii][0],Coord::IMAGE);
str << ',' << rr;
diff --git a/tksao/frame/base.C b/tksao/frame/base.C
index 2d15a85..e790ecf 100644
--- a/tksao/frame/base.C
+++ b/tksao/frame/base.C
@@ -133,6 +133,13 @@ Base::Base(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item)
useCrosshair = 0;
+ precArcsec = 3;
+ precArcmin = 5;
+ precDeg = 10;
+ precLinear = 8;
+ precHMS = 4;
+ precDMS = 3;
+
markerEpsilon = 3;
showMarkers = 1;
showMarkersText = 1;
@@ -753,7 +760,7 @@ void Base::doubleToTclArray(double dd, const char* var,
str << base << "," << mod << ends;
ostringstream vstr;
- vstr << setprecision(8) << dd << ends;
+ vstr << setprecision(precLinear) << dd << ends;
Tcl_SetVar2(interp, (char*)var, str.str().c_str(), vstr.str().c_str(), 0);
}
diff --git a/tksao/frame/base.h b/tksao/frame/base.h
index 79184b8..4ee4024 100644
--- a/tksao/frame/base.h
+++ b/tksao/frame/base.h
@@ -249,6 +249,13 @@ public:
int useCrosshair;
+ int precArcsec;
+ int precArcmin;
+ int precDeg;
+ int precLinear;
+ int precHMS;
+ int precDMS;
+
int markerEpsilon; // mouse tolerance for select/edit
int showMarkers;
int showMarkersText;
diff --git a/tksao/frame/basecommand.C b/tksao/frame/basecommand.C
index 50e2eea..a745d14 100644
--- a/tksao/frame/basecommand.C
+++ b/tksao/frame/basecommand.C
@@ -1762,14 +1762,14 @@ void Base::getFitsSizeCmd(Coord::CoordSystem sys, Coord::SkyFrame sky,
ostringstream str;
switch (dist) {
case Coord::DEGREE:
- str << setprecision(10);
+ str << setprecision(precDeg);
break;
case Coord::ARCMIN:
- str << setprecision(5) << fixed;
+ str << setprecision(precArcmin) << fixed;
ss *= 60;
break;
case Coord::ARCSEC:
- str << setprecision(3) << fixed;
+ str << setprecision(precArcsec) << fixed;
ss *= 60*60;
break;
}
diff --git a/tksao/frame/baseline.C b/tksao/frame/baseline.C
index a7348f0..05609dc 100644
--- a/tksao/frame/baseline.C
+++ b/tksao/frame/baseline.C
@@ -110,7 +110,8 @@ void BaseLine::listNonCel(FitsImage* ptr, ostream& str, Coord::CoordSystem sys)
{
Vector v1 = ptr->mapFromRef(p1,sys);
Vector v2 = ptr->mapFromRef(p2,sys);
- str << type_ << '(' << setprecision(8) << v1 << ',' << v2 << ')';
+ str << type_ << '(' << setprecision(parent->precLinear)
+ << v1 << ',' << v2 << ')';
}
// special composite funtionallity
diff --git a/tksao/frame/basepolygon.C b/tksao/frame/basepolygon.C
index e712b36..569f48b 100644
--- a/tksao/frame/basepolygon.C
+++ b/tksao/frame/basepolygon.C
@@ -260,7 +260,7 @@ void BasePolygon::listBaseNonCel(FitsImage* ptr, ostream& str, Matrix& mm,
first=0;
Vector vv = ptr->mapFromRef(vertex.current()->vector*mm,sys);
- str << setprecision(8) << vv;
+ str << setprecision(parent->precLinear) << vv;
}
while (vertex.next());
str << ')';
diff --git a/tksao/frame/box.C b/tksao/frame/box.C
index 3cb081b..59a19f7 100644
--- a/tksao/frame/box.C
+++ b/tksao/frame/box.C
@@ -272,9 +272,10 @@ void Box::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
Vector rr = ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCSEC);
double aa = parent->mapAngleFromRef(angle,sys,sky);
str << type_ << '(' << ra << ',' << dec << ','
- << setprecision(3) << fixed << setunit('"') << rr << ',';
+ << setprecision(parent->precArcsec) << fixed << setunit('"')
+ << rr << ',';
str.unsetf(ios_base::floatfield);
- str << setprecision(8) << radToDeg(aa) << ')';
+ str << setprecision(parent->precLinear) << radToDeg(aa) << ')';
}
else
listNonCel(ptr, str, sys);
@@ -308,7 +309,8 @@ void Box::listNonCel(FitsImage* ptr, ostream& str, Coord::CoordSystem sys)
Vector vv = ptr->mapFromRef(center,sys);
Vector rr = ptr->mapLenFromRef(annuli_[0],sys);
double aa = parent->mapAngleFromRef(angle,sys);
- str << type_ << '(' << setprecision(8) << vv << ',' << rr << ','
+ str << type_ << '(' << setprecision(parent->precLinear) << vv << ','
+ << rr << ','
<< radToDeg(aa) << ')';
}
@@ -344,7 +346,8 @@ void Box::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
{
Vector vv = ptr->mapFromRef(center,Coord::PHYSICAL);
Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::PHYSICAL);
- str << type_ << '(' << setprecision(8) << vv << ',' << rr << ','
+ str << type_ << '(' << setprecision(parent->precLinear) << vv << ','
+ << rr << ','
<< radToDeg(angle) << ')';
}
break;
@@ -353,9 +356,10 @@ void Box::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
listRADEC(ptr,center,sys,Coord::FK5,Coord::SEXAGESIMAL);
Vector rr = ptr->mapLenFromRef(annuli_[0],sys,Coord::ARCMIN);
str << type_ << '(' << ra << ',' << dec << ','
- << setprecision(5) << fixed << setunit('\'') << rr << ',';
+ << setprecision(parent->precArcmin) << fixed << setunit('\'')
+ << rr << ',';
str.unsetf(ios_base::floatfield);
- str << setprecision(8) << radToDeg(angle) << ')';
+ str << setprecision(parent->precLinear) << radToDeg(angle) << ')';
}
}
@@ -377,7 +381,8 @@ void Box::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
{
Vector vv = ptr->mapFromRef(center,Coord::IMAGE);
Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE);
- str << type_ << '(' << setprecision(8) << vv << ',' << rr << ','
+ str << type_ << '(' << setprecision(parent->precLinear) << vv << ','
+ << rr << ','
<< radToDeg(angle) << ')';
}
break;
@@ -386,8 +391,8 @@ void Box::listSAOtng(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
listRADEC(ptr,center,sys,sky,format);
Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE);
str << type_ << '(' << ra << ',' << dec << ','
- << setprecision(8) << rr << ','
- << setprecision(8) << radToDeg(angle) << ')';
+ << setprecision(parent->precLinear) << rr << ','
+ << setprecision(parent->precLinear) << radToDeg(angle) << ')';
}
}
@@ -409,8 +414,9 @@ void Box::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
Vector vv = ptr->mapFromRef(center,sys);
Vector rr = ptr->mapLenFromRef(annuli_[0],Coord::IMAGE);
coord.listProsCoordSystem(str,sys,sky);
- str << "; "<< type_ << ' ' << setprecision(8) << vv << ' ' << rr << ' '
- << radToDeg(angle);
+ str << "; "<< type_ << ' ' << setprecision(parent->precLinear)
+ << vv << ' ' << rr << ' '
+ << radToDeg(angle);
}
break;
default:
@@ -427,9 +433,10 @@ void Box::listPros(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
str << ra << ' ' << dec << ' ';
break;
}
- str << setprecision(3) << fixed << setunit('"') << rr << ' ';
+ str << setprecision(parent->precArcsec) << fixed << setunit('"')
+ << rr << ' ';
str.unsetf(ios_base::floatfield);
- str << setprecision(8) << radToDeg(angle);
+ str << setprecision(parent->precLinear) << radToDeg(angle);
}
}
@@ -442,7 +449,8 @@ void Box::listSAOimage(ostream& str, int strip)
listSAOimagePre(str);
Vector vv = ptr->mapFromRef(center,Coord::IMAGE);
- str << type_ << '(' << setprecision(8) << vv << ',' << annuli_[0] << ','
+ str << type_ << '(' << setprecision(parent->precLinear) << vv << ','
+ << annuli_[0] << ','
<< radToDeg(angle) << ')';
listSAOimagePost(str, strip);
diff --git a/tksao/frame/boxannulus.C b/tksao/frame/boxannulus.C
index 2534369..45bfe4b 100644
--- a/tksao/frame/boxannulus.C
+++ b/tksao/frame/boxannulus.C
@@ -289,13 +289,13 @@ void BoxAnnulus::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
listRADEC(ptr,center,sys,sky,format);
double aa = parent->mapAngleFromRef(angle,sys,sky);
str << "box(" << ra << ',' << dec
- << setprecision(3) << fixed;
+ << setprecision(parent->precArcsec) << fixed;
for (int ii=0; ii<numAnnuli_; ii++) {
Vector rr = ptr->mapLenFromRef(annuli_[ii],sys,Coord::ARCSEC);
str << ',' << setunit('"') << rr;
}
str.unsetf(ios_base::floatfield);
- str << setprecision(8) << ',' << radToDeg(aa) << ')';
+ str << setprecision(parent->precLinear) << ',' << radToDeg(aa) << ')';
}
else
listNonCel(ptr, str, sys);
@@ -309,7 +309,7 @@ void BoxAnnulus::listNonCel(FitsImage* ptr, ostream& str,
{
Vector vv = ptr->mapFromRef(center,sys);
double aa = parent->mapAngleFromRef(angle,sys);
- str << "box(" << setprecision(8) << vv;
+ str << "box(" << setprecision(parent->precLinear) << vv;
for (int ii=0; ii<numAnnuli_; ii++) {
Vector rr = ptr->mapLenFromRef(annuli_[ii],sys);
str << ',' << rr;
@@ -352,7 +352,8 @@ void BoxAnnulus::listPros(ostream& str, Coord::CoordSystem sys,
str << "; ";
Vector rr = ptr->mapLenFromRef(annuli_[ii],Coord::IMAGE);
- str << "box " << setprecision(8) << vv << ' ' << rr << ' '
+ str << "box " << setprecision(parent->precLinear) << vv << ' '
+ << rr << ' '
<< radToDeg(angle);
if (ii!=0) {
@@ -382,9 +383,10 @@ void BoxAnnulus::listPros(ostream& str, Coord::CoordSystem sys,
str << ra << ' ' << dec << ' ';
break;
}
- str << setprecision(3) << setunit('"') << fixed << rr << ' ';
+ str << setprecision(parent->precArcsec) << setunit('"') << fixed
+ << rr << ' ';
str.unsetf(ios_base::floatfield);
- str << setprecision(8) << radToDeg(angle);
+ str << setprecision(parent->precLinear) << radToDeg(angle);
if (ii!=0) {
Vector r1 = ptr->mapLenFromRef(annuli_[ii-1],sys,Coord::ARCSEC);
@@ -397,9 +399,10 @@ void BoxAnnulus::listPros(ostream& str, Coord::CoordSystem sys,
str << ra << ' ' << dec << ' ';
break;
}
- str << setprecision(3) << setunit('"') << fixed << r1 << ' ';
+ str << setprecision(parent->precArcsec) << setunit('"') << fixed
+ << r1 << ' ';
str.unsetf(ios_base::floatfield);
- str << setprecision(8) << radToDeg(angle);
+ str << setprecision(parent->precLinear) << radToDeg(angle);
}
listProsPost(str, strip);
}
@@ -414,11 +417,11 @@ void BoxAnnulus::listSAOimage(ostream& str, int strip)
for (int ii=0; ii<numAnnuli_; ii++) {
Vector vv = ptr->mapFromRef(center,Coord::IMAGE);
- str << "box(" << setprecision(8) << vv << ','
+ str << "box(" << setprecision(parent->precLinear) << vv << ','
<< annuli_[ii] << ',' << radToDeg(angle) << ')';
if (ii!=0)
- str << " & !box(" << setprecision(8) << vv << ','
+ str << " & !box(" << setprecision(parent->precLinear) << vv << ','
<< annuli_[ii-1] << ',' << radToDeg(angle) << ')';
listSAOimagePost(str, strip);
diff --git a/tksao/frame/bpanda.C b/tksao/frame/bpanda.C