summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-08-07 17:14:48 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-08-07 17:14:48 (GMT)
commit01952508444434a9bde013b5c972ace97e0ed31a (patch)
treec95ee7b57124392705cf9fd1a9d4a75730396a2e
parent00894180a16881554659fccfe1501f450030b00a (diff)
downloadblt-01952508444434a9bde013b5c972ace97e0ed31a.zip
blt-01952508444434a9bde013b5c972ace97e0ed31a.tar.gz
blt-01952508444434a9bde013b5c972ace97e0ed31a.tar.bz2
implement astFormat()
-rw-r--r--tksao/frame/fitsimage.C16
-rw-r--r--tksao/frame/fitsmap.C11
-rw-r--r--tksao/frame/frame3dbase.C8
-rw-r--r--tksao/frame/framebase.C8
4 files changed, 15 insertions, 28 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C
index 3aedfd2..328ed55 100644
--- a/tksao/frame/fitsimage.C
+++ b/tksao/frame/fitsimage.C
@@ -2693,8 +2693,7 @@ char* FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
case Coord::DEGREES:
out = zero360(radToDeg(out));
str << setprecision(context_->parent_->precDeg_)
- << out[0] << ' ' << out[1] << ' '
- << (hasWCSCel(sys) ? coord.skyFrameStr(sky) : "") << ends;
+ << out[0] << ' ' << out[1] << ends;
break;
@@ -2719,9 +2718,8 @@ char* FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
setWCSFormat(2,dms.str().c_str());
break;
}
- str << astFormat(ast_,1,out[0]) << ' '
- << astFormat(ast_,2,out[1]) << ' '
- << (hasWCSCel(sys) ? coord.skyFrameStr(sky) : "") << ends;
+ str << astFormat(ast_,1,out[0]) << ' ' << astFormat(ast_,2,out[1])
+ << ends;
}
break;
}
@@ -2773,8 +2771,7 @@ char* FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys,
case Coord::DEGREES:
out = zero360(radToDeg(out));
str << setprecision(context_->parent_->precDeg_)
- << out[0] << ' ' << out[1] << ' ' << out[2]
- << ' ' << (hasWCSCel(sys) ? coord.skyFrameStr(sky) : "") << ends;
+ << out[0] << ' ' << out[1] << ' ' << out[2] << ends;
break;
case Coord::SEXAGESIMAL:
@@ -2798,9 +2795,8 @@ char* FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys,
setWCSFormat(2,dms.str().c_str());
break;
}
- str << astFormat(ast_,1,out[0]) << ' '
- << astFormat(ast_,2,out[1]) << ' ' << out[2] << ' '
- << (hasWCSCel(sys) ? coord.skyFrameStr(sky) : "") << ends;
+ str << astFormat(ast_,1,out[0]) << ' ' << astFormat(ast_,2,out[1])
+ << ' ' << out[2] << ends;
}
break;
}
diff --git a/tksao/frame/fitsmap.C b/tksao/frame/fitsmap.C
index 432fdba..3c90534 100644
--- a/tksao/frame/fitsmap.C
+++ b/tksao/frame/fitsmap.C
@@ -114,17 +114,8 @@ void FitsImage::listFromRef(ostream& str, const Vector& vv,
break;
case Coord::SEXAGESIMAL:
{
- char buf[64];
- buf[0] = '\0';
+ char buf[128];
mapFromRef(vv, sys, sky, format, buf);
-
- // grap only the first two items
- char* ptr = buf;
- while (*ptr)
- ptr++;
- while (*ptr != ' ' && ptr >= buf)
- ptr--;
- *ptr = '\0';
str << buf;
}
break;
diff --git a/tksao/frame/frame3dbase.C b/tksao/frame/frame3dbase.C
index 5349651..473e420 100644
--- a/tksao/frame/frame3dbase.C
+++ b/tksao/frame/frame3dbase.C
@@ -198,12 +198,12 @@ void Frame3dBase::getInfoWCS(char* var, Vector3d& rr, FitsImage* ptr,
}
char* wcsname = (char*)sptr->getWCSName(www);
- if (wcsname)
+ if (sptr->hasWCSCel(www))
+ Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),coord.skyFrameStr(wcsSkyFrame_),0);
+ else if (wcsname)
Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),wcsname,0);
- else if (argc > 3 && argv && argv[3])
- Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),argv[3],0);
else
- Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),"",0);
+ Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),coord.coordSystemStr(www),0);
Tcl_Free((char*)argv);
}
diff --git a/tksao/frame/framebase.C b/tksao/frame/framebase.C
index a2e4e53..4d1a98c 100644
--- a/tksao/frame/framebase.C
+++ b/tksao/frame/framebase.C
@@ -171,12 +171,12 @@ void FrameBase::getInfoWCS(char* var, Vector& rr, FitsImage* ptr,
}
char* wcsname = (char*)sptr->getWCSName(www);
- if (wcsname)
+ if (sptr->hasWCSCel(www))
+ Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),coord.skyFrameStr(wcsSkyFrame_),0);
+ else if (wcsname)
Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),wcsname,0);
- else if (argc > 2 && argv && argv[2])
- Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),argv[2],0);
else
- Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),"",0);
+ Tcl_SetVar2(interp,var,varcat(buf,(char*)"wcs",ww,(char*)",sys"),coord.coordSystemStr(www),0);
Tcl_Free((char*)argv);
}