summaryrefslogtreecommitdiffstats
path: root/tksao
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-12-01 17:01:10 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-12-01 17:01:10 (GMT)
commit1fdd3f87f855491aabe98a6772e952457d222644 (patch)
treec4ddeb3526da4de4ca27de2d0b13ada7d038ec47 /tksao
parent6ac9587702e94857e264cc672fb7fd5b6a35ffb0 (diff)
downloadblt-1fdd3f87f855491aabe98a6772e952457d222644.zip
blt-1fdd3f87f855491aabe98a6772e952457d222644.tar.gz
blt-1fdd3f87f855491aabe98a6772e952457d222644.tar.bz2
update AST WCS
Diffstat (limited to 'tksao')
-rw-r--r--tksao/frame/fitsimage.C22
-rw-r--r--tksao/frame/fitsimage.h12
-rw-r--r--tksao/frame/fr3dmap.C6
-rw-r--r--tksao/vector/vector.h7
4 files changed, 24 insertions, 23 deletions
diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C
index cc3b1ef..353ac5c 100644
--- a/tksao/frame/fitsimage.C
+++ b/tksao/frame/fitsimage.C
@@ -3099,7 +3099,7 @@ const char* FitsImage::getWCSName(Coord::CoordSystem sys)
#endif
#ifndef NEWWCS
-Vector FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
+Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
Coord::SkyFrame sky)
{
astClearStatus;
@@ -3122,7 +3122,7 @@ Vector FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
return Vector();
}
#else
-Vector FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
+Vector FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
Coord::SkyFrame sky)
{
astClearStatus; // just to make sure
@@ -3144,7 +3144,7 @@ Vector FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
return Vector();
}
-Vector3d FitsImage::pix2wcs(Vector3d in, Coord::CoordSystem sys,
+Vector3d FitsImage::pix2wcs(const Vector3d& in, Coord::CoordSystem sys,
Coord::SkyFrame sky)
{
astClearStatus; // just to make sure
@@ -3168,7 +3168,7 @@ Vector3d FitsImage::pix2wcs(Vector3d in, Coord::CoordSystem sys,
#endif
#ifndef NEWWCS
-char* FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
+char* FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
Coord::SkyFrame sky, Coord::SkyFormat format,
char* lbuf)
{
@@ -3229,7 +3229,7 @@ char* FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
return lbuf;
}
#else
-char* FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
+char* FitsImage::pix2wcs(const Vector& in, Coord::CoordSystem sys,
Coord::SkyFrame sky, Coord::SkyFormat format,
char* lbuf)
{
@@ -3291,7 +3291,7 @@ char* FitsImage::pix2wcs(Vector in, Coord::CoordSystem sys,
#endif
#ifndef NEWWCS
-Vector FitsImage::wcs2pix(Vector in, Coord::CoordSystem sys,
+Vector FitsImage::wcs2pix(const Vector& in, Coord::CoordSystem sys,
Coord::SkyFrame sky)
{
astClearStatus;
@@ -3315,7 +3315,7 @@ Vector FitsImage::wcs2pix(Vector in, Coord::CoordSystem sys,
return Vector();
}
#else
-Vector FitsImage::wcs2pix(Vector in, Coord::CoordSystem sys,
+Vector FitsImage::wcs2pix(const Vector& vv, Coord::CoordSystem sys,
Coord::SkyFrame sky)
{
astClearStatus; // just to make sure
@@ -3324,6 +3324,7 @@ Vector FitsImage::wcs2pix(Vector in, Coord::CoordSystem sys,
setWCSSystem(newast_,sys);
setWCSSkyFrame(newast_,sky);
+ Vector in = vv;
if (wcsIsASkyFrame(newast_))
in *= M_PI/180.;
@@ -3336,7 +3337,7 @@ Vector FitsImage::wcs2pix(Vector in, Coord::CoordSystem sys,
return Vector();
}
-Vector3d FitsImage::wcs2pix(Vector3d in, Coord::CoordSystem sys,
+Vector3d FitsImage::wcs2pix(const Vector3d& vv, Coord::CoordSystem sys,
Coord::SkyFrame sky)
{
astClearStatus; // just to make sure
@@ -3345,6 +3346,7 @@ Vector3d FitsImage::wcs2pix(Vector3d in, Coord::CoordSystem sys,
setWCSSystem(newast_,sys);
setWCSSkyFrame(newast_,sky);
+ Vector3d in = vv;
if (wcsIsASkyFrame(newast_))
in *= M_PI/180.;
@@ -3967,7 +3969,7 @@ int FitsImage::wcsIsASkyFrame(AstFrameSet* ast)
#endif
#ifndef NEWWCS
-Vector FitsImage::wcsTran(AstFrameSet* ast, Vector& in, int forward)
+Vector FitsImage::wcsTran(AstFrameSet* ast, const Vector& in, int forward)
{
double xout, yout;
astTran2(ast, 1, in.v, in.v+1, forward, &xout, &yout);
@@ -4001,7 +4003,7 @@ void FitsImage::wcsTran(AstFrameSet* ast, int npoint,
}
#else
-Vector FitsImage::wcsTran(AstFrameSet* ast, Vector& in, int forward)
+Vector FitsImage::wcsTran(AstFrameSet* ast, const Vector& in, int forward)
{
int naxes = astGetI(ast,"Naxes");
switch (naxes) {
diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h
index db0951e..bf473bc 100644
--- a/tksao/frame/fitsimage.h
+++ b/tksao/frame/fitsimage.h
@@ -364,14 +364,14 @@ class FitsImage {
int isIIS() {return iisMode_;}
Vector& iisz() {return iisz_;}
- Vector pix2wcs(Vector, Coord::CoordSystem, Coord::SkyFrame);
- char* pix2wcs(Vector, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, char*);
+ Vector pix2wcs(const Vector&, Coord::CoordSystem, Coord::SkyFrame);
+ char* pix2wcs(const Vector&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, char*);
- Vector wcs2pix(Vector, Coord::CoordSystem, Coord::SkyFrame);
+ Vector wcs2pix(const Vector&, Coord::CoordSystem, Coord::SkyFrame);
#ifdef NEWWCS
- Vector3d pix2wcs(Vector3d, Coord::CoordSystem, Coord::SkyFrame);
- Vector3d wcs2pix(Vector3d, Coord::CoordSystem, Coord::SkyFrame);
+ Vector3d pix2wcs(const Vector3d&, Coord::CoordSystem, Coord::SkyFrame);
+ Vector3d wcs2pix(const Vector3d&, Coord::CoordSystem, Coord::SkyFrame);
#endif
double pix2wcsx(double, Coord::CoordSystem, int);
double wcs2pixx(double, Coord::CoordSystem, int);
@@ -406,7 +406,7 @@ class FitsImage {
#endif
int wcsIsASkyFrame(AstFrameSet*);
- Vector wcsTran(AstFrameSet*, Vector&, int);
+ Vector wcsTran(AstFrameSet*, const Vector&, int);
void wcsTran(AstFrameSet*, int, Vector*, int, Vector*);
double wcsDistance(AstFrameSet*, Vector, Vector);
#ifdef NEWWCS
diff --git a/tksao/frame/fr3dmap.C b/tksao/frame/fr3dmap.C
index 6f39dec..a4465d3 100644
--- a/tksao/frame/fr3dmap.C
+++ b/tksao/frame/fr3dmap.C
@@ -74,9 +74,9 @@ Vector3d Frame3dBase::mapToRef3d(const Vector& vv, Coord::InternalSystem sys,
Vector3d ii=xx-zz;
Vector3d jj=yy-zz;
Vector3d nn = cross(jj,ii).normalize();
- double& a = nn[0];
- double& b = nn[1];
- double& c = nn[2];
+ double a = nn[0];
+ double b = nn[1];
+ double c = nn[2];
double d = -a*xx[0] -b*xx[1] -c*xx[2];
Vector ww;
diff --git a/tksao/vector/vector.h b/tksao/vector/vector.h
index 55efda8..915c81c 100644
--- a/tksao/vector/vector.h
+++ b/tksao/vector/vector.h
@@ -38,10 +38,9 @@ class Vector {
Vector(const Vector3d&);
Vector& operator=(const Vector3d&);
- double& operator[](int i)
- {return v[i];} // return element
- double* vv()
- {return v;} // return vector
+ const double& operator[](int i) const {return v[i];} // return element
+ double& operator[](int i) {return v[i];} // return element
+ double* vv() {return v;} // return vector
Vector& origin()
{v[0]=0; v[1]=0; v[2]=1; return *this;}