summaryrefslogtreecommitdiffstats
path: root/tksao
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-11-07 22:11:59 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-11-07 22:11:59 (GMT)
commit138d03e5624d405ad5cf4319ebab2210f8ce2672 (patch)
tree709f05846a6d807385b8439ca46e4f0d25901531 /tksao
parent31e0d69941f31e61e5c242cef79e0bd916fe4ace (diff)
downloadblt-138d03e5624d405ad5cf4319ebab2210f8ce2672.zip
blt-138d03e5624d405ad5cf4319ebab2210f8ce2672.tar.gz
blt-138d03e5624d405ad5cf4319ebab2210f8ce2672.tar.bz2
add mask range
Diffstat (limited to 'tksao')
-rw-r--r--tksao/frame/fitsdata.C30
-rw-r--r--tksao/frame/fitsdata.h6
-rw-r--r--tksao/frame/fitsimage.h3
-rw-r--r--tksao/frame/frame.C2
4 files changed, 1 insertions, 40 deletions
diff --git a/tksao/frame/fitsdata.C b/tksao/frame/fitsdata.C
index f566731..f4483df 100644
--- a/tksao/frame/fitsdata.C
+++ b/tksao/frame/fitsdata.C
@@ -1651,36 +1651,6 @@ template <> double FitsDatam<double>::getValueDouble(const Vector& v)
return NAN;
}
-// getValueMask
-
-template <class T> int FitsDatam<T>::getValueMask(const Vector& v)
-{
- Vector r = v;
- long x = (long)r[0];
- long y = (long)r[1];
-
- if (x >= 0 && x < width_ && y >= 0 && y < height_)
- return data_[y*width_ + x] ? 1 : 0;
- else
- return 0;
-}
-
-template <class T> int FitsDatam<T>::getValueMask(double xx, double yy)
-{
- long x = (long)xx;
- long y = (long)yy;
-
- if (x >= 0 && x < width_ && y >= 0 && y < height_)
- return data_[y*width_ + x] ? 1 : 0;
- else
- return 0;
-}
-
-template<class T> int FitsDatam<T>::getValueMask(long i)
-{
- return data_[i] ? 1 : 0;
-}
-
// bin
template<class T> void FitsDatam<T>::hist(double* arr, int length, double mn,
diff --git a/tksao/frame/fitsdata.h b/tksao/frame/fitsdata.h
index e18d57f..b324e57 100644
--- a/tksao/frame/fitsdata.h
+++ b/tksao/frame/fitsdata.h
@@ -106,12 +106,9 @@ public:
virtual const char* getValue(const Vector&) =0;
virtual float getValueFloat(const Vector&) =0;
virtual double getValueDouble(const Vector&) =0;
- virtual int getValueMask(const Vector&) =0;
- virtual int getValueMask(double,double) =0;
virtual float getValueFloat(long) =0;
virtual double getValueDouble(long) =0;
- virtual int getValueMask(long) =0;
double min();
const Vector& minXY() {return minXY_;}
@@ -159,12 +156,9 @@ class FitsDatam : public FitsData {
float getValueFloat(const Vector&);
double getValueDouble(const Vector&);
- int getValueMask(const Vector&);
- int getValueMask(double, double);
float getValueFloat(long i);
double getValueDouble(long i);
- int getValueMask(long i);
void updateClip(FrScale*, FitsBound*);
void hist(double*, int, double, double, FitsBound*);
diff --git a/tksao/frame/fitsimage.h b/tksao/frame/fitsimage.h
index 5c4fe87..19445b8 100644
--- a/tksao/frame/fitsimage.h
+++ b/tksao/frame/fitsimage.h
@@ -481,12 +481,9 @@ class FitsImage {
const char* getValue(const Vector& v);
float getValueFloat(const Vector& v) {return data_->getValueFloat(v);}
double getValueDouble(const Vector& v) {return data_->getValueDouble(v);}
- int getValueMask(const Vector& v) {return data_->getValueMask(v);}
- int getValueMask(double x, double y) {return data_->getValueMask(x,y);}
float getValueFloat(long i) {return data_->getValueFloat(i);}
double getValueDouble(long i) {return data_->getValueDouble(i);}
- int getValueMask(long i) {return data_->getValueMask(i);}
void setClip(double l, double h) {data_->setClip(l,h);}
diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C
index 7713df4..bb99824 100644
--- a/tksao/frame/frame.C
+++ b/tksao/frame/frame.C
@@ -256,7 +256,7 @@ unsigned char* Frame::fillMask(FitsMask* msk, int width, int height,
if (xx>=params->xmin && xx<params->xmax &&
yy>=params->ymin && yy<params->ymax) {
- double value = sptr->getValueDouble(long(yy)*srcw + long(xx));
+ float value = sptr->getValueFloat(long(yy)*srcw + long(xx));
switch (mark) {
case FitsMask::ZERO: