Skip to content
Snippets Groups Projects
Commit 62ddb3f9 authored by Jordi Inglada's avatar Jordi Inglada
Browse files

BUG: correct ranges for soil index

parent 8b7ced7d
No related branches found
No related tags found
No related merge requests found
......@@ -43,10 +43,10 @@ const typename SoilDataBase::SoilDataVector& SoilDataBase::GetDB() const
double SoilDataBase::GetReflectance(size_t SoilIndex, WavelenghtType wl) const
{
if(SoilIndex<1 || SoilIndex > m_SoilDataVector.size()-1)
if(SoilIndex<1 || SoilIndex > m_SoilDataVector.size())
{
std::stringstream errmessg;
errmessg << "Soil index must be > 0 and <= " << m_SoilDataVector.size()+1 <<'\n';
errmessg << "Soil index must be > 0 and <= " << m_SoilDataVector.size() <<'\n';
throw std::range_error( errmessg.str() );
}
// wl not in the set of measured ones
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment