Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
6db2f219
Commit
6db2f219
authored
14 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
ENH use horner scheme to compute noise in TerraSAR calibration
parent
b5008396
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Radiometry/otbTerraSarCalibrationFunctor.h
+3
-0
3 additions, 0 deletions
Code/Radiometry/otbTerraSarCalibrationFunctor.h
Code/Radiometry/otbTerraSarCalibrationFunctor.txx
+19
-18
19 additions, 18 deletions
Code/Radiometry/otbTerraSarCalibrationFunctor.txx
with
22 additions
and
18 deletions
Code/Radiometry/otbTerraSarCalibrationFunctor.h
+
3
−
0
View file @
6db2f219
...
...
@@ -159,6 +159,9 @@ private:
/** Return the current NEBN value */
inline
double
ComputeNoiseEquivalentBetaNaught
(
double
range
)
const
;
/** Evaluate polynom with Horner scheme*/
inline
double
Horner
(
std
::
vector
<
double
>
&
coefficients
,
const
double
nebn
)
const
;
/** Calibration Factor */
double
m_CalibrationFactor
;
...
...
This diff is collapsed.
Click to expand it.
Code/Radiometry/otbTerraSarCalibrationFunctor.txx
+
19
−
18
View file @
6db2f219
...
...
@@ -59,31 +59,16 @@ TerraSarCalibrationFunctor<TInput, TOutput>
::ComputeNoiseEquivalentBetaNaught(double range) const
{
// Formula: NEBN = Ks * SUM( coef_i * (tau - tau_ref)^i)
// Retrieve the polynomial degree
unsigned int polynomialDegree = m_NoiseRecord.get_polynomialDegree();
// Compute tau - tau_ref
double deltaTau = range - m_NoiseRecord.get_referencePoint();
const
double deltaTau = range - m_NoiseRecord.get_referencePoint();
// Get polynomial coefficients
std::vector<double> coefficients = m_NoiseRecord.get_polynomialCoefficients();
// Initialize nebn value
double nebn = 0.;
// For each degree
std::vector<double>::const_iterator coefIt = coefficients.begin();
unsigned int degree = 0;
// Evaluate
double nebn = Horner (coefficients, deltaTau);
while(coefIt != coefficients.end() && degree <= polynomialDegree)
{
// Cumulate polynomial
nebn += (*coefIt) * vcl_pow(deltaTau,static_cast<double>(degree));
++degree;
++coefIt;
}
// Do not forget to multiply by the calibration factor
nebn*=m_CalibrationFactor;
...
...
@@ -91,6 +76,22 @@ TerraSarCalibrationFunctor<TInput, TOutput>
return nebn;
}
template <class TInput, class TOutput>
double TerraSarCalibrationFunctor<TInput, TOutput>
::Horner(std::vector<double> & coefficients, const double nebn) const
{
std::vector<double>::const_reverse_iterator coefIt = coefficients.rbegin();
double res = *(coefIt);
++coefIt;
while(coefIt != coefficients.rend())
{
// Cumulate polynomial
res= res*nebn + (*coefIt);
++coefIt;
}
return res;
}
template <class TInput, class TOutput>
TOutput
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment