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
0a311912
Commit
0a311912
authored
10 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Improved performance.
parent
e5b04072
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
src/main/java/org/orekit/rugged/api/SensorMeanPlaneCrossing.java
+31
-20
31 additions, 20 deletions
...n/java/org/orekit/rugged/api/SensorMeanPlaneCrossing.java
src/test/java/org/orekit/rugged/api/RuggedTest.java
+1
-1
1 addition, 1 deletion
src/test/java/org/orekit/rugged/api/RuggedTest.java
with
32 additions
and
21 deletions
src/main/java/org/orekit/rugged/api/SensorMeanPlaneCrossing.java
+
31
−
20
View file @
0a311912
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
*/
*/
package
org.orekit.rugged.api
;
package
org.orekit.rugged.api
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.math3.analysis.differentiation.DerivativeStructure
;
import
org.apache.commons.math3.analysis.differentiation.DerivativeStructure
;
import
org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D
;
import
org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D
;
import
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
;
import
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
;
...
@@ -30,8 +33,17 @@ import org.orekit.utils.PVCoordinates;
...
@@ -30,8 +33,17 @@ import org.orekit.utils.PVCoordinates;
/** Class dedicated to when ground point crosses mean sensor plane. */
/** Class dedicated to when ground point crosses mean sensor plane. */
class
SensorMeanPlaneCrossing
{
class
SensorMeanPlaneCrossing
{
/** Converter between spacecraft and body. */
/** Number of points for frames interpolation. */
private
final
SpacecraftToObservedBody
scToBody
;
private
static
final
int
INTERPOLATION_POINTS
=
5
;
/** Line numbers of the middle sample point. */
private
final
int
midLine
;
/** Transforms sample from observed body frame to inertial frame. */
private
final
List
<
Transform
>
bodyToInertial
;
/** Transforms sample from spacecraft frame to inertial frame. */
private
final
List
<
Transform
>
scToInertial
;
/** Minimum line number in the search interval. */
/** Minimum line number in the search interval. */
private
final
int
minLine
;
private
final
int
minLine
;
...
@@ -54,15 +66,6 @@ class SensorMeanPlaneCrossing {
...
@@ -54,15 +66,6 @@ class SensorMeanPlaneCrossing {
/** Accuracy to use for finding crossing line number. */
/** Accuracy to use for finding crossing line number. */
private
final
double
accuracy
;
private
final
double
accuracy
;
/** Middle line. */
private
final
double
midLine
;
/** Transform from observed body to inertial frame, for middle line. */
private
final
Transform
midLineBodyToInert
;
/** Transform from inertial frame to spacecraft frame, for middle line. */
private
final
Transform
midLineScToInert
;
/** Simple constructor.
/** Simple constructor.
* @param sensor sensor to consider
* @param sensor sensor to consider
* @param scToBody converter between spacecraft and body
* @param scToBody converter between spacecraft and body
...
@@ -84,7 +87,6 @@ class SensorMeanPlaneCrossing {
...
@@ -84,7 +87,6 @@ class SensorMeanPlaneCrossing {
try
{
try
{
this
.
sensor
=
sensor
;
this
.
sensor
=
sensor
;
this
.
scToBody
=
scToBody
;
this
.
minLine
=
minLine
;
this
.
minLine
=
minLine
;
this
.
maxLine
=
maxLine
;
this
.
maxLine
=
maxLine
;
this
.
lightTimeCorrection
=
lightTimeCorrection
;
this
.
lightTimeCorrection
=
lightTimeCorrection
;
...
@@ -94,10 +96,19 @@ class SensorMeanPlaneCrossing {
...
@@ -94,10 +96,19 @@ class SensorMeanPlaneCrossing {
// compute one the transforms for middle line, as they will be reused
// compute one the transforms for middle line, as they will be reused
// as the start point for all searches
// as the start point for all searches
midLine
=
0.5
*
(
minLine
+
maxLine
);
bodyToInertial
=
new
ArrayList
<
Transform
>(
INTERPOLATION_POINTS
);
final
AbsoluteDate
date
=
sensor
.
getDate
(
midLine
);
scToInertial
=
new
ArrayList
<
Transform
>(
INTERPOLATION_POINTS
);
midLineBodyToInert
=
scToBody
.
getInertialToBody
(
date
).
getInverse
();
int
middle
=
-
1
;
midLineScToInert
=
scToBody
.
getScToInertial
(
date
);
for
(
int
i
=
0
;
i
<
INTERPOLATION_POINTS
;
++
i
)
{
final
int
line
=
(
i
*
maxLine
+
(
INTERPOLATION_POINTS
-
i
)
*
minLine
)
/
INTERPOLATION_POINTS
;
if
(
i
==
INTERPOLATION_POINTS
/
2
)
{
middle
=
line
;
}
final
AbsoluteDate
date
=
sensor
.
getDate
(
line
);
bodyToInertial
.
add
(
scToBody
.
getInertialToBody
(
date
).
getInverse
());
scToInertial
.
add
(
scToBody
.
getScToInertial
(
date
));
}
midLine
=
middle
;
}
catch
(
OrekitException
oe
)
{
}
catch
(
OrekitException
oe
)
{
throw
new
RuggedException
(
oe
,
oe
.
getSpecifier
(),
oe
.
getParts
());
throw
new
RuggedException
(
oe
,
oe
.
getSpecifier
(),
oe
.
getParts
());
...
@@ -173,8 +184,8 @@ class SensorMeanPlaneCrossing {
...
@@ -173,8 +184,8 @@ class SensorMeanPlaneCrossing {
// We expect two or three evaluations only. Each new evaluation shows up quickly in
// We expect two or three evaluations only. Each new evaluation shows up quickly in
// the performances as it involves frames conversions
// the performances as it involves frames conversions
double
crossingLine
=
midLine
;
double
crossingLine
=
midLine
;
Transform
bodyToInert
=
midLineB
odyToInert
;
Transform
bodyToInert
=
b
odyToInert
ial
.
get
(
INTERPOLATION_POINTS
/
2
)
;
Transform
scToInert
=
midLineScToInert
;
Transform
scToInert
=
scToInertial
.
get
(
INTERPOLATION_POINTS
/
2
)
;
boolean
atMin
=
false
;
boolean
atMin
=
false
;
boolean
atMax
=
false
;
boolean
atMax
=
false
;
for
(
int
i
=
0
;
i
<
maxEval
;
++
i
)
{
for
(
int
i
=
0
;
i
<
maxEval
;
++
i
)
{
...
@@ -213,8 +224,8 @@ class SensorMeanPlaneCrossing {
...
@@ -213,8 +224,8 @@ class SensorMeanPlaneCrossing {
}
}
final
AbsoluteDate
date
=
sensor
.
getDate
(
crossingLine
);
final
AbsoluteDate
date
=
sensor
.
getDate
(
crossingLine
);
bodyToInert
=
scToBody
.
getInertialToBody
(
date
).
get
In
v
er
se
(
);
bodyToInert
=
Transform
.
interpolate
(
date
,
false
,
false
,
bodyTo
Iner
tial
);
scToInert
=
scToBody
.
getS
cToInertial
(
date
);
scToInert
=
Transform
.
interpolate
(
date
,
false
,
false
,
s
cToInertial
);
}
}
return
null
;
return
null
;
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/orekit/rugged/api/RuggedTest.java
+
1
−
1
View file @
0a311912
...
@@ -436,7 +436,7 @@ public class RuggedTest {
...
@@ -436,7 +436,7 @@ public class RuggedTest {
throws
RuggedException
,
OrekitException
,
URISyntaxException
{
throws
RuggedException
,
OrekitException
,
URISyntaxException
{
long
t0
=
System
.
currentTimeMillis
();
long
t0
=
System
.
currentTimeMillis
();
int
dimension
=
10
00
;
int
dimension
=
22
00
;
String
path
=
getClass
().
getClassLoader
().
getResource
(
"orekit-data"
).
toURI
().
getPath
();
String
path
=
getClass
().
getClassLoader
().
getResource
(
"orekit-data"
).
toURI
().
getPath
();
DataProvidersManager
.
getInstance
().
addProvider
(
new
DirectoryCrawler
(
new
File
(
path
)));
DataProvidersManager
.
getInstance
().
addProvider
(
new
DirectoryCrawler
(
new
File
(
path
)));
...
...
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