Skip to content
Snippets Groups Projects
Commit 257e2ece authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

ENH: SpectralResponse GetFunctionValues method change.

parent fb07552e
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,7 @@ public:
void SetFromImage(ImagePointerType image);
/** Transform the SR in a Filter Function (6S parameters)*/
FilterFunctionValuesPointerType GetFilterFunctionValues(double step = 0.0025) const;
FilterFunctionValuesPointerType GetFilterFunctionValues(double step = 0.0025);
/** Get the wavelength of the first and last not null reflectance */
IntervalType GetInterval()
......
......@@ -236,15 +236,15 @@ void SpectralResponse<TPrecision, TValuePrecision>::SetFromImage(ImagePointerTyp
template<class TPrecision, class TValuePrecision>
typename SpectralResponse<TPrecision, TValuePrecision>::FilterFunctionValuesPointerType SpectralResponse<TPrecision,
TValuePrecision>::GetFilterFunctionValues(double step) const
TValuePrecision>::GetFilterFunctionValues(double step)
{
//Assume that the SR is sorted
typename FilterFunctionValuesType::ValuesVectorType valuesVector;
const Self& responseCalculator = *this;
for (double i = m_Response.front()->first; i <= m_Response.back()->first; i += step)
Self& responseCalculator = *this;
for (double i = m_Response.front().first; i <= m_Response.back().first; i += step)
{
valuesVector.push_back( responseCalculator(i) );
valuesVector.push_back(responseCalculator(i));
}
FilterFunctionValuesPointerType functionValues = FilterFunctionValuesType::New();
......
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