diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-07-28 19:15:37 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-07-28 19:15:37 (GMT) |
commit | c05398ec1b743547ea7af7a375cc64edd132cb57 (patch) | |
tree | 96a232006c2cd378a76951eb957ccdf20dece1ac | |
parent | 24eb94699f8fcc135bc253c052a3eb9fc7ce4113 (diff) | |
download | blt-c05398ec1b743547ea7af7a375cc64edd132cb57.zip blt-c05398ec1b743547ea7af7a375cc64edd132cb57.tar.gz blt-c05398ec1b743547ea7af7a375cc64edd132cb57.tar.bz2 |
simplify marker code
-rw-r--r-- | tksao/frame/fitsimage.h | 2 | ||||
-rw-r--r-- | tksao/frame/fitsmap.C | 18 | ||||
-rw-r--r-- | tksao/util/util.C | 14 | ||||
-rw-r--r-- | tksao/util/util.h | 2 |
4 files changed, 20 insertions, 16 deletions
diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h index 2c0c11f..88a1969 100644 --- a/tksao/frame/fitsimage.h +++ b/tksao/frame/fitsimage.h @@ -191,6 +191,8 @@ class FitsImage { int checkWCS(Vector3d&); AstFrameSet* fits2ast(FitsHead*); + Vector mapLen(const Vector& v, const Matrix& mx); + public: char* fileName; char* rootBaseFileName; diff --git a/tksao/frame/fitsmap.C b/tksao/frame/fitsmap.C index 3c5f052..8b34f35 100644 --- a/tksao/frame/fitsmap.C +++ b/tksao/frame/fitsmap.C @@ -143,6 +143,24 @@ void FitsImage::listFromRef(ostream& str, const Vector& vv, // Map Length +Vector FitsImage::mapLen(const Vector& vv, const Matrix& mx) +{ + // imageToPhysical/Amplifier/Dector have no rotation, only scale/translation + // just grap scale + return vv*Scale(mx); + + // remove translation + // Vector tt = Vector() * mx; + // Matrix sr = mx * Translate(-tt); + + // remove rotation + // Vector rr = Vector(1,0) * sr; + // Matrix ss = sr * Rotate(rr.angle()); + + // all that is left is Scaling + // return (vv*ss).abs(); +} + double FitsImage::mapLenFromRef(double dd, Coord::CoordSystem sys, Coord::DistFormat dist) { diff --git a/tksao/util/util.C b/tksao/util/util.C index 9351adb..6475a6d 100644 --- a/tksao/util/util.C +++ b/tksao/util/util.C @@ -520,20 +520,6 @@ int dCompare(const void* a, const void* b) return 0; } -Vector mapLen(const Vector& v, const Matrix& mx) -{ - // remove translation - Vector t = Vector() * mx; - Matrix sr = mx * Translate(-t); - - // remove rotation - Vector r = Vector(1,0) * sr; - Matrix s = sr * Rotate(r.angle()); - - // all that is left is Scaling - return (v*s).abs(); -} - #if defined (MAC_OSX_TK) || (_WIN32) int XSetClipRectangles(Display *d, GC gc, int clip_x_origin, int clip_y_origin, diff --git a/tksao/util/util.h b/tksao/util/util.h index dc1d6bf..4728f2d 100644 --- a/tksao/util/util.h +++ b/tksao/util/util.h @@ -130,6 +130,4 @@ extern const char* psFontName(const char*, const char*, const char*); extern int fCompare(const void*, const void*); extern int dCompare(const void*, const void*); - -extern Vector mapLen(const Vector& v, const Matrix& mx); #endif |