Skip to content
Snippets Groups Projects
Commit 7b81b2ef authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

WRG: signed-unsigned comparison in RadarFunctors

parent 96e48dc9
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ TerraSarCalibrationImageFunctor<TInput, TOutput> ...@@ -45,7 +45,7 @@ TerraSarCalibrationImageFunctor<TInput, TOutput>
m_PRF = 1.; m_PRF = 1.;
} }
template <class TInput, class TOutput> template <class TInput, class TOutput>
double double
TerraSarCalibrationImageFunctor<TInput, TOutput> TerraSarCalibrationImageFunctor<TInput, TOutput>
...@@ -63,11 +63,11 @@ TerraSarCalibrationImageFunctor<TInput, TOutput> ...@@ -63,11 +63,11 @@ TerraSarCalibrationImageFunctor<TInput, TOutput>
{ {
curRange = m_NoiseRangeValidityRef + ( m_NoiseRangeValidityMax-m_NoiseRangeValidityRef )/width_2 * (static_cast<double>(colId+1) - width_2 ); curRange = m_NoiseRangeValidityRef + ( m_NoiseRangeValidityMax-m_NoiseRangeValidityRef )/width_2 * (static_cast<double>(colId+1) - width_2 );
} }
return curRange; return curRange;
} }
template <class TInput, class TOutput> template <class TInput, class TOutput>
typename TerraSarCalibrationImageFunctor<TInput, TOutput>::DoubleVectorType typename TerraSarCalibrationImageFunctor<TInput, TOutput>::DoubleVectorType
TerraSarCalibrationImageFunctor<TInput, TOutput> TerraSarCalibrationImageFunctor<TInput, TOutput>
...@@ -75,7 +75,7 @@ TerraSarCalibrationImageFunctor<TInput, TOutput> ...@@ -75,7 +75,7 @@ TerraSarCalibrationImageFunctor<TInput, TOutput>
{ {
DoubleVectorType curCoeffs; DoubleVectorType curCoeffs;
if(m_UseFastCalibrationMethod) if(m_UseFastCalibrationMethod)
{ {
curCoeffs = m_NoisePolynomialCoefficientsList[0]; curCoeffs = m_NoisePolynomialCoefficientsList[0];
} }
else else
...@@ -89,7 +89,7 @@ TerraSarCalibrationImageFunctor<TInput, TOutput> ...@@ -89,7 +89,7 @@ TerraSarCalibrationImageFunctor<TInput, TOutput>
bool go = true; bool go = true;
// deduct the corresponding noise acquisition index // deduct the corresponding noise acquisition index
while( id<m_TimeUTC.size() && go) while( id<m_TimeUTC.size() && go)
{ {
if( currTimeUTC < m_TimeUTC[id] ) if( currTimeUTC < m_TimeUTC[id] )
go = false; go = false;
id++; id++;
...@@ -114,19 +114,19 @@ TerraSarCalibrationImageFunctor<TInput, TOutput> ...@@ -114,19 +114,19 @@ TerraSarCalibrationImageFunctor<TInput, TOutput>
{ {
double diffCurRange = ComputeCurrentNoise( static_cast<unsigned int>(index[0]) ) - m_NoiseRangeValidityRef; double diffCurRange = ComputeCurrentNoise( static_cast<unsigned int>(index[0]) ) - m_NoiseRangeValidityRef;
DoubleVectorType curCoeff = ComputeCurrentCoeffs( static_cast<unsigned int>(index[1]) ); DoubleVectorType curCoeff = ComputeCurrentCoeffs( static_cast<unsigned int>(index[1]) );
TOutput outRadBr = m_RadarBrightness( inPix ); TOutput outRadBr = m_RadarBrightness( inPix );
double NEBN = 0.; double NEBN = 0.;
for(int i=0; i<curCoeff.size(); i++) for(unsigned int i=0; i<curCoeff.size(); i++)
{ {
NEBN += curCoeff[i]*vcl_pow( diffCurRange, i); NEBN += curCoeff[i]*vcl_pow( diffCurRange, i);
} }
double sigma = ( outRadBr - m_CalFactor*NEBN ) * m_SinLocalIncidentAngle; double sigma = ( outRadBr - m_CalFactor*NEBN ) * m_SinLocalIncidentAngle;
return static_cast<TOutput>(sigma); return static_cast<TOutput>(sigma);
} }
/** Constructor */ /** Constructor */
template <class TInput, class TOutput> template <class TInput, class TOutput>
...@@ -145,7 +145,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput> ...@@ -145,7 +145,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
m_PRF = 1.; m_PRF = 1.;
} }
template <class TInput, class TOutput> template <class TInput, class TOutput>
double double
TerraSarCalibrationComplexImageFunctor<TInput, TOutput> TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
...@@ -163,11 +163,11 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput> ...@@ -163,11 +163,11 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
{ {
curRange = m_NoiseRangeValidityRef + ( m_NoiseRangeValidityMax-m_NoiseRangeValidityRef )/width_2 * (static_cast<double>(colId+1) - width_2 ); curRange = m_NoiseRangeValidityRef + ( m_NoiseRangeValidityMax-m_NoiseRangeValidityRef )/width_2 * (static_cast<double>(colId+1) - width_2 );
} }
return curRange; return curRange;
} }
template <class TInput, class TOutput> template <class TInput, class TOutput>
typename TerraSarCalibrationComplexImageFunctor<TInput, TOutput>::DoubleVectorType typename TerraSarCalibrationComplexImageFunctor<TInput, TOutput>::DoubleVectorType
TerraSarCalibrationComplexImageFunctor<TInput, TOutput> TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
...@@ -175,7 +175,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput> ...@@ -175,7 +175,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
{ {
DoubleVectorType curCoeffs; DoubleVectorType curCoeffs;
if(m_UseFastCalibrationMethod) if(m_UseFastCalibrationMethod)
{ {
curCoeffs = m_NoisePolynomialCoefficientsList[0]; curCoeffs = m_NoisePolynomialCoefficientsList[0];
} }
else else
...@@ -189,7 +189,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput> ...@@ -189,7 +189,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
bool go = true; bool go = true;
// deduct the corresponding noise acquisition index // deduct the corresponding noise acquisition index
while( id<m_TimeUTC.size() && go) while( id<m_TimeUTC.size() && go)
{ {
if( currTimeUTC < m_TimeUTC[id] ) if( currTimeUTC < m_TimeUTC[id] )
go = false; go = false;
id++; id++;
...@@ -214,7 +214,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput> ...@@ -214,7 +214,7 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
{ {
double diffCurRange = this->ComputeCurrentNoise( static_cast<unsigned int>(index[0]) ) - this->GetNoiseRangeValidityRef(); double diffCurRange = this->ComputeCurrentNoise( static_cast<unsigned int>(index[0]) ) - this->GetNoiseRangeValidityRef();
DoubleVectorType curCoeff = this->ComputeCurrentCoeffs( static_cast<unsigned int>(index[1]) ); DoubleVectorType curCoeff = this->ComputeCurrentCoeffs( static_cast<unsigned int>(index[1]) );
double modulus = std::abs(inPix); double modulus = std::abs(inPix);
double outRadBr = static_cast<double>(m_RadarBrightness( modulus )); double outRadBr = static_cast<double>(m_RadarBrightness( modulus ));
...@@ -224,15 +224,15 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput> ...@@ -224,15 +224,15 @@ TerraSarCalibrationComplexImageFunctor<TInput, TOutput>
NEBN += curCoeff[i]*vcl_pow( diffCurRange, i); NEBN += curCoeff[i]*vcl_pow( diffCurRange, i);
} }
double sigma = ( outRadBr - this->GetCalFactor()*NEBN ) * this->GetSinLocalIncidentAngle(); double sigma = ( outRadBr - this->GetCalFactor()*NEBN ) * this->GetSinLocalIncidentAngle();
double phase = std::arg(inPix); double phase = std::arg(inPix);
TOutput out(sigma*vcl_cos(phase), sigma*vcl_sin(phase)); TOutput out(sigma*vcl_cos(phase), sigma*vcl_sin(phase));
return out; return out;
} }
}// namespace Functor }// namespace Functor
} // namespace otb } // namespace otb
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment