diff --git a/stim/envi/bsq.h b/stim/envi/bsq.h index 387838d..63f5b39 100644 --- a/stim/envi/bsq.h +++ b/stim/envi/bsq.h @@ -650,13 +650,24 @@ public: //to make sure the left and the right bound are in the bandwidth if (lb < w[0] || rb < w[0] || lb > w[n-1] || rb >w[n-1]){ - std::cout<<"ERROR: left bound or right bound out of bandwidth"< w[n - 1]) { + std::cout << "bsq::area ERROR - left bound " << lb << " is above the maximum available wavelength " << w[n - 1] << std::endl; + } + if (rb > w[n - 1]) { + std::cout << "bsq::area ERROR - right bound " << rb << " is above the maximum available wavelength " << w[0] << std::endl; + } + return false; } //to make sure right bound is bigger than left bound else if(lb > rb){ - std::cout<<"ERROR: right bound should be bigger than left bound"<*)file)->ph_to_ph((double*)result, lb1, rb1, pos1, lb2, rb2, pos2, mask); else - std::cout<<"ERROR: unidentified data type"<*)file)->ph_to_ph((double*)result, lb1, rb1, pos1, lb2, rb2, pos2, mask); else - std::cout<<"ERROR: unidentified data type"<*)file)->ph_to_ph((double*)result, lb1, rb1, pos1, lb2, rb2, pos2, mask); else - std::cout<<"ERROR: unidentified data type"< #include -#include +#include //use limits and remove the MIN and MAX macros +#define NOMINMAX #include #include #include @@ -79,10 +80,12 @@ class image{ #endif /// Returns the value for "white" based on the dynamic range (assumes white is 1.0 for floating point images) T white(){ - return std::numeric_limits::max(); + if (typeid(T) == typeid(double) || typeid(T) == typeid(float)) + return (T)1.0; + else + return std::numeric_limits::max(); } - public: size_t bytes() { return size() * sizeof(T); } -- libgit2 0.21.4