Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged
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
Container Registry
Model registry
Operate
Environments
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
Orekit
Rugged
Commits
5e4e05f5
Commit
5e4e05f5
authored
8 years ago
by
LabatAllee Lucie
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://www.orekit.org/git/rugged-refining-main
parents
ad183da4
8ab23001
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/tutorials/java/AffinagePleiades/AffinageRugged.java
+4
-4
4 additions, 4 deletions
src/tutorials/java/AffinagePleiades/AffinageRugged.java
src/tutorials/java/AffinagePleiades/LocalisationMetrics.java
+59
-12
59 additions, 12 deletions
src/tutorials/java/AffinagePleiades/LocalisationMetrics.java
with
63 additions
and
16 deletions
src/tutorials/java/AffinagePleiades/AffinageRugged.java
+
4
−
4
View file @
5e4e05f5
...
...
@@ -203,8 +203,8 @@ public class AffinageRugged {
System
.
out
.
format
(
" **** Initial Residuals **** %n"
);
LocalisationMetrics
initlialResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
);
System
.
out
.
format
(
"residuals max : %3.
6
e mean %3.
6e
%n"
,
initlialResiduals
.
getMaxResidual
(),
initlialResiduals
.
getMeanResidual
());
LocalisationMetrics
initlialResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
,
false
);
System
.
out
.
format
(
"residuals max : %3.
4
e mean %3.
4e meters
%n"
,
initlialResiduals
.
getMaxResidual
(),
initlialResiduals
.
getMeanResidual
());
...
...
@@ -245,8 +245,8 @@ public class AffinageRugged {
System
.
out
.
format
(
" **** Compute Statistics **** %n"
);
LocalisationMetrics
localisationResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
);
System
.
out
.
format
(
"residuals max : %3.
6
e mean %3.
6
e %n"
,
localisationResiduals
.
getMaxResidual
(),
localisationResiduals
.
getMeanResidual
());
LocalisationMetrics
localisationResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
,
false
);
System
.
out
.
format
(
"residuals max : %3.
4
e mean %3.
4
e
meters
%n"
,
localisationResiduals
.
getMaxResidual
(),
localisationResiduals
.
getMeanResidual
());
//RealVector residuals = optimum.getResiduals();
...
...
This diff is collapsed.
Click to expand it.
src/tutorials/java/AffinagePleiades/LocalisationMetrics.java
+
59
−
12
View file @
5e4e05f5
...
...
@@ -27,6 +27,7 @@ import org.orekit.rugged.linesensor.LineSensor;
import
org.orekit.rugged.linesensor.SensorPixel
;
import
org.orekit.rugged.errors.RuggedException
;
import
org.orekit.time.AbsoluteDate
;
import
org.s2geolib.utils.S2GeolibConstants
;
import
java.util.Collections
;
import
java.util.Collection
;
...
...
@@ -56,7 +57,10 @@ public class LocalisationMetrics {
private
PleiadesViewingModel
viewingModel
;
private
int
measureCount
;
private
final
double
EARTH_RADIUS
=
637100000
d
;
private
boolean
computeInDeg
;
/* max residual distance */
private
double
resMax
;
...
...
@@ -71,15 +75,15 @@ public class LocalisationMetrics {
*
* </p>
*/
public
LocalisationMetrics
(
SensorToGroundMapping
groundTruthMapping
,
Rugged
rugged
)
throws
RuggedException
public
LocalisationMetrics
(
SensorToGroundMapping
groundTruthMapping
,
Rugged
rugged
,
boolean
computeInDeg
)
throws
RuggedException
{
groundTruthMappings
=
groundTruthMapping
.
getMappings
();
this
.
rugged
=
rugged
;
this
.
sensor
=
rugged
.
getLineSensor
(
groundTruthMapping
.
getSensorName
());
this
.
computeInDeg
=
computeInDeg
;
this
.
computeMetrics
();
}
...
...
@@ -100,6 +104,47 @@ public class LocalisationMetrics {
}
/**
* Compute distance between point (lonDeg1, latDeg1) and point (lonDeg2, latDeg2) in meters
* @param lonDeg1
* @param latDeg1
* @param lonDeg2
* @param latDeg2
* @return distance between point (lonDeg1, latDeg1) and point (lonDeg2, latDeg2)
*/
private
double
computeDistance
(
double
lonDeg1
,
double
latDeg1
,
double
lonDeg2
,
double
latDeg2
)
{
double
returned
;
double
xRad1
=
FastMath
.
toRadians
(
lonDeg1
);
double
xRad2
=
FastMath
.
toRadians
(
lonDeg2
);
double
yRad1
=
FastMath
.
toRadians
(
latDeg1
);
double
yRad2
=
FastMath
.
toRadians
(
latDeg2
);
returned
=
computeDistanceRad
(
xRad1
,
yRad1
,
xRad2
,
yRad2
);
return
returned
;
}
/**
* distance in meters between point (xRad1, yRad1) and point (xRad2, yRad2)
* @param xRad1
* @param xRad2
* @param yRad1
* @param yRad2
* @return
*/
private
double
computeDistanceRad
(
double
xRad1
,
double
yRad1
,
double
xRad2
,
double
yRad2
)
{
double
returned
;
double
sinValue
=
FastMath
.
sin
(
xRad1
)
*
FastMath
.
sin
(
xRad2
);
double
deltaLambda
=
FastMath
.
abs
(
yRad1
-
yRad2
);
double
cosValue
=
FastMath
.
cos
(
xRad1
)
*
FastMath
.
cos
(
xRad2
)
*
FastMath
.
cos
(
deltaLambda
);
double
deltaPhy
=
FastMath
.
acos
(
sinValue
+
cosValue
);
if
(
Double
.
isNaN
(
deltaPhy
))
{
deltaPhy
=
0
d
;
}
returned
=
EARTH_RADIUS
/
100
*
deltaPhy
;
return
returned
;
}
public
void
computeMetrics
()
throws
RuggedException
{
...
...
@@ -110,7 +155,6 @@ public class LocalisationMetrics {
double
count
=
0
;
resMax
=
0
;
int
k
=
groundTruthMappings
.
size
();
Iterator
<
Map
.
Entry
<
SensorPixel
,
GeodeticPoint
>>
gtIt
=
groundTruthMappings
.
iterator
();
...
...
@@ -126,14 +170,17 @@ public class LocalisationMetrics {
GeodeticPoint
esGP
=
rugged
.
directLocation
(
date
,
sensor
.
getPosition
(),
sensor
.
getLOS
(
date
,
(
int
)
gtSP
.
getPixelNumber
()));
double
distance
=
0
;
double
lonDiff
=
esGP
.
getLongitude
()
-
gtGP
.
getLongitude
();
double
latDiff
=
esGP
.
getLatitude
()
-
gtGP
.
getLatitude
();
double
altDiff
=
esGP
.
getAltitude
()
-
gtGP
.
getAltitude
();
//longDiffVector.append(lonDiff);
//latDiffVector.append(latDiff);
//altDiffVector.append(altDiff);
double
distance
=
Math
.
sqrt
(
lonDiff
*
lonDiff
+
latDiff
*
latDiff
+
altDiff
*
altDiff
);
if
(
this
.
computeInDeg
==
true
)
{
double
lonDiff
=
esGP
.
getLongitude
()
-
gtGP
.
getLongitude
();
double
latDiff
=
esGP
.
getLatitude
()
-
gtGP
.
getLatitude
();
double
altDiff
=
esGP
.
getAltitude
()
-
gtGP
.
getAltitude
();
distance
=
Math
.
sqrt
(
lonDiff
*
lonDiff
+
latDiff
*
latDiff
+
altDiff
*
altDiff
);
}
else
distance
=
computeDistance
(
esGP
.
getLongitude
(),
esGP
.
getLatitude
(),
gtGP
.
getLongitude
()
,
gtGP
.
getLatitude
());
count
+=
distance
;
if
(
distance
>
resMax
)
{
...
...
@@ -144,8 +191,8 @@ public class LocalisationMetrics {
}
//resMax = distanceVector.getMaxValue();
//System.out.format(Locale.US, "max: %3.6e %n ",distanceVector.getMaxValue() )
;
//System.out.format(Locale.US, "max: %3.6e %n ",distanceVector.getMaxValue() )
resMean
=
count
/
k
;
//System.out.format("number of points %d %n", k);
}
...
...
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