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
64c8abff
Commit
64c8abff
authored
8 years ago
by
Jonathan Guinet
Browse files
Options
Downloads
Patches
Plain Diff
update affinage
parent
038bcb8a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tutorials/java/AffinagePleiades/AffinageRugged.java
+57
-28
57 additions, 28 deletions
src/tutorials/java/AffinagePleiades/AffinageRugged.java
with
57 additions
and
28 deletions
src/tutorials/java/AffinagePleiades/AffinageRugged.java
+
57
−
28
View file @
64c8abff
...
...
@@ -63,8 +63,8 @@ public class AffinageRugged {
// Initialize Orekit, assuming an orekit-data folder is in user home directory
File
home
=
new
File
(
System
.
getProperty
(
"user.home"
));
//
File orekitData = new File(home, "workspace/data/orekit-data");
File
orekitData
=
new
File
(
home
,
"COTS/orekit-data"
);
File
orekitData
=
new
File
(
home
,
"workspace/data/orekit-data"
);
//
File orekitData = new File(home, "COTS/orekit-data");
DataProvidersManager
.
getInstance
().
addProvider
(
new
DirectoryCrawler
(
orekitData
));
...
...
@@ -117,32 +117,43 @@ public class AffinageRugged {
Vector3D
position
=
lineSensor
.
getPosition
();
// This returns a zero vector since we set the relative position of the sensor w.r.T the satellite to 0.
AbsoluteDate
firstLineDate
=
lineSensor
.
getDate
(
pleiadesViewingModel
.
dimension
/
2
);
System
.
out
.
format
(
"date %s %n"
,
firstLineDate
.
toString
());
AbsoluteDate
firstLineDate
=
lineSensor
.
getDate
(
0
);
Vector3D
los
=
lineSensor
.
getLOS
(
firstLineDate
,
0
);
GeodeticPoint
upLeftPoint
=
rugged
.
directLocation
(
firstLineDate
,
position
,
los
);
System
.
out
.
format
(
Locale
.
US
,
"upper left point: φ = %8.10f °, λ = %8.10f °, h = %8.3f m%n"
,
FastMath
.
toDegrees
(
upLeftPoint
.
getLatitude
()),
FastMath
.
toDegrees
(
upLeftPoint
.
getLongitude
()),
upLeftPoint
.
getAltitude
());
los
=
lineSensor
.
getLOS
(
firstLineDate
,
pleiadesViewingModel
.
dimension
-
1
);
GeodeticPoint
upRightPoint
=
rugged
.
directLocation
(
firstLineDate
,
position
,
los
);
System
.
out
.
format
(
Locale
.
US
,
"upper right point: φ = %8.10f °, λ = %8.10f °, h = %8.3f m%n"
,
FastMath
.
toDegrees
(
upRightPoint
.
getLatitude
()),
FastMath
.
toDegrees
(
upRightPoint
.
getLongitude
()),
upRightPoint
.
getAltitude
());
los
=
lineSensor
.
getLOS
(
firstL
ineDate
,
pleiadesViewingModel
.
dimension
/
2
);
GeodeticPoint
centerPoint
=
rugged
.
directLocation
(
firstL
ineDate
,
position
,
los
);
System
.
out
.
format
(
Locale
.
US
,
"center
point
: φ = %8.10f °, λ = %8.10f °, h = %8.3f m%n"
,
//
GeodeticPoint upRightPoint = rugged.directLocation(firstLineDate, position, los);
AbsoluteDate
lineDate
=
lineSensor
.
getDate
(
pleiadesViewingModel
.
dimension
/
2
);
los
=
lineSensor
.
getLOS
(
l
ineDate
,
pleiadesViewingModel
.
dimension
/
2
);
GeodeticPoint
centerPoint
=
rugged
.
directLocation
(
l
ineDate
,
position
,
los
);
System
.
out
.
format
(
Locale
.
US
,
"center
geodetic position
: φ = %8.10f °, λ = %8.10f °, h = %8.3f m%n"
,
FastMath
.
toDegrees
(
centerPoint
.
getLatitude
()),
FastMath
.
toDegrees
(
centerPoint
.
getLongitude
()),
centerPoint
.
getAltitude
());
int
pixelPosition
=
pleiadesViewingModel
.
dimension
-
1
;
los
=
lineSensor
.
getLOS
(
firstLineDate
,
pixelPosition
);
GeodeticPoint
upperRight
=
rugged
.
directLocation
(
firstLineDate
,
position
,
los
);
AbsoluteDate
lineDate_y
=
lineSensor
.
getDate
(
pleiadesViewingModel
.
dimension
-
1
);
los
=
lineSensor
.
getLOS
(
lineDate_y
,
0
);
GeodeticPoint
lowerLeft
=
rugged
.
directLocation
(
lineDate_y
,
position
,
los
);
System
.
out
.
format
(
" **** Add roll and pitch values **** %n"
);
double
GSD_X
=
DistanceTools
.
computeDistanceRad
(
upLeftPoint
.
getLongitude
(),
upLeftPoint
.
getLatitude
(),
upperRight
.
getLongitude
()
,
upperRight
.
getLatitude
())/
pleiadesViewingModel
.
dimension
;
double
GSD_Y
=
DistanceTools
.
computeDistanceRad
(
upLeftPoint
.
getLongitude
(),
upLeftPoint
.
getLatitude
(),
lowerLeft
.
getLongitude
()
,
lowerLeft
.
getLatitude
())/
pleiadesViewingModel
.
dimension
;
double
rollValue
=
FastMath
.
toRadians
(
0.1
);
double
pitchValue
=
FastMath
.
toRadians
(-
0.3
);
double
factorValue
=
0.5
;
System
.
out
.
format
(
" GSD X %2.2f Y %2.2f **** %n"
,
GSD_X
,
GSD_Y
);
System
.
out
.
format
(
" **** Add roll and pitch values **** %n"
);
double
rollValue
=
FastMath
.
toRadians
(-
0.01
);
double
pitchValue
=
FastMath
.
toRadians
(
0.02
);
double
factorValue
=
1.05
;
System
.
out
.
format
(
"roll : %3.5f pitch : %3.5f factor : %3.5f \n"
,
rollValue
,
pitchValue
,
factorValue
);
...
...
@@ -172,9 +183,29 @@ public class AffinageRugged {
int
lineSampling
=
1000
;
int
pixelSampling
=
1000
;
//measure.CreateMeasure(lineSampling, pixelSampling);
measure
.
CreateNoisyMeasure
(
lineSampling
,
pixelSampling
);
// Test with noisy measures
//double pixErr = 0.0;
//double altErr = 0.0;
final
double
[]
pixErr
=
new
double
[
4
];
pixErr
[
0
]
=
0
;
// lat mean
pixErr
[
1
]
=
0.1
;
// lat std
pixErr
[
2
]
=
0
;
// lon mean
pixErr
[
3
]
=
0.1
;
// lon std
final
double
[]
altErr
=
new
double
[
2
];
altErr
[
0
]
=
1.0
;
//mean
altErr
[
1
]
=
3.0
;
//std
measure
.
CreateNoisyMeasure
(
lineSampling
,
pixelSampling
,
pixErr
,
altErr
);
// Test with noisy measures
System
.
out
.
format
(
"nb TiePoints %d %n"
,
measure
.
getMeasureCount
());
System
.
out
.
format
(
" **** Initial Residuals **** %n"
);
LocalisationMetrics
gtResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
,
false
);
System
.
out
.
format
(
"gt residuals max : %3.4f mean %3.4f meters %n"
,
gtResiduals
.
getMaxResidual
(),
gtResiduals
.
getMeanResidual
());
System
.
out
.
format
(
" **** Reset Roll/Pitch/Factor **** %n"
);
rugged
.
getLineSensor
(
pleiadesViewingModel
.
getSensorName
()).
...
...
@@ -204,20 +235,20 @@ public class AffinageRugged {
System
.
out
.
format
(
" **** Initial Residuals **** %n"
);
LocalisationMetrics
initlialResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
,
false
);
System
.
out
.
format
(
"residuals max : %3.4
e
mean %3.4
e
meters %n"
,
initlialResiduals
.
getMaxResidual
(),
initlialResiduals
.
getMeanResidual
());
System
.
out
.
format
(
"residuals max : %3.4
f
mean %3.4
f
meters %n"
,
initlialResiduals
.
getMaxResidual
(),
initlialResiduals
.
getMeanResidual
());
System
.
out
.
format
(
" **** Start optimization **** %n"
);
// perform parameters estimation
int
maxIterations
=
1
5
;
double
convergenceThreshold
=
1
e
-
1
2
;
int
maxIterations
=
1
00
;
double
convergenceThreshold
=
1
e
-
1
0
;
System
.
out
.
format
(
"iterations max %d convergence threshold %3.6e \n"
,
maxIterations
,
convergenceThreshold
);
Optimum
optimum
=
rugged
.
estimateFreeParameters
(
Collections
.
singletonList
(
measure
.
getMapping
()),
maxIterations
,
convergenceThreshold
);
System
.
out
.
format
(
"max value %3.6e %n"
,
optimum
.
getResiduals
().
getMaxValue
());
System
.
out
.
format
(
" Optimization performed in %d iterations \n"
,
optimum
.
getEvaluations
());
...
...
@@ -247,12 +278,10 @@ public class AffinageRugged {
LocalisationMetrics
localisationResiduals
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
,
false
);
System
.
out
.
format
(
"residuals max : %3.4e mean %3.4e meters %n"
,
localisationResiduals
.
getMaxResidual
(),
localisationResiduals
.
getMeanResidual
());
//RealVector residuals = optimum.getResiduals();
LocalisationMetrics
localisationResidualsDeg
=
new
LocalisationMetrics
(
measure
.
getMapping
(),
rugged
,
true
);
System
.
out
.
format
(
"residuals max : %3.4e deg mean %3.4e deg %n"
,
localisationResidualsDeg
.
getMaxResidual
(),
localisationResidualsDeg
.
getMeanResidual
());
}
catch
(
OrekitException
oe
)
{
System
.
err
.
println
(
oe
.
getLocalizedMessage
());
System
.
exit
(
1
);
...
...
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