Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged-MOD
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
youngcle
Rugged-MOD
Commits
6b023157
Commit
6b023157
authored
8 years ago
by
sesteves
Browse files
Options
Downloads
Patches
Plain Diff
fixed exception handling
parent
bd3473a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/orekit/rugged/atmosphericrefraction/MultiLayerModel.java
+60
-71
60 additions, 71 deletions
.../orekit/rugged/atmosphericrefraction/MultiLayerModel.java
with
60 additions
and
71 deletions
src/main/java/org/orekit/rugged/atmosphericrefraction/MultiLayerModel.java
+
60
−
71
View file @
6b023157
...
...
@@ -16,6 +16,7 @@
*/
package
org.orekit.rugged.atmosphericrefraction
;
import
com.sun.org.apache.xpath.internal.operations.Mult
;
import
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
;
import
org.apache.commons.math3.util.FastMath
;
import
org.orekit.bodies.OneAxisEllipsoid
;
...
...
@@ -37,90 +38,78 @@ import java.util.*;
public
class
MultiLayerModel
implements
AtmosphericRefraction
{
// maps altitude (lower bound) to refraction index
private
static
final
Map
<
Double
,
Double
>
meanAtmosphericRefractions
;
private
static
final
Map
<
Double
,
ExtendedEllipsoid
>
atmosphericEllipsoids
;
static
{
Map
<
Double
,
Double
>
refractions
=
new
TreeMap
(
Collections
.
reverseOrder
());
refractions
.
put
(-
1000.00000000000
,
1.00030600000
);
refractions
.
put
(
0.00000000000
,
1.00027800000
);
refractions
.
put
(
1000.00000000000
,
1.00025200000
);
refractions
.
put
(
3000.00000000000
,
1.00020600000
);
refractions
.
put
(
5000.00000000000
,
1.00016700000
);
refractions
.
put
(
7000.00000000000
,
1.00013400000
);
refractions
.
put
(
9000.00000000000
,
1.00010600000
);
refractions
.
put
(
11000.00000000000
,
1.00008300000
);
refractions
.
put
(
14000.00000000000
,
1.00005200000
);
refractions
.
put
(
18000.00000000000
,
1.00002800000
);
refractions
.
put
(
23000.00000000000
,
1.00001200000
);
refractions
.
put
(
30000.00000000000
,
1.00000400000
);
refractions
.
put
(
40000.00000000000
,
1.00000100000
);
refractions
.
put
(
50000.00000000000
,
1.00000000000
);
refractions
.
put
(
100000.00000000000
,
1.00000000000
);
meanAtmosphericRefractions
=
Collections
.
unmodifiableMap
(
refractions
);
Map
<
Double
,
ExtendedEllipsoid
>
ellipsoids
=
new
HashMap
<
Double
,
ExtendedEllipsoid
>();
try
{
for
(
Double
altitude
:
refractions
.
keySet
())
{
OneAxisEllipsoid
ellipsoid
=
new
OneAxisEllipsoid
(
Constants
.
WGS84_EARTH_EQUATORIAL_RADIUS
+
altitude
,
Constants
.
WGS84_EARTH_FLATTENING
,
FramesFactory
.
getITRF
(
IERSConventions
.
IERS_2010
,
true
));
ellipsoid
=
new
ExtendedEllipsoid
(
ellipsoid
.
getEquatorialRadius
(),
ellipsoid
.
getFlattening
(),
ellipsoid
.
getBodyFrame
());
ellipsoids
.
put
(
altitude
,
(
ExtendedEllipsoid
)
ellipsoid
);
}
}
catch
(
OrekitException
e
)
{
e
.
printStackTrace
();
private
static
Map
<
Double
,
Double
>
meanAtmosphericRefractions
;
private
static
Map
<
Double
,
ExtendedEllipsoid
>
atmosphericEllipsoids
;
public
MultiLayerModel
()
throws
OrekitException
{
Map
<
Double
,
Double
>
meanAtmosphericRefractions
=
new
TreeMap
(
Collections
.
reverseOrder
());
meanAtmosphericRefractions
.
put
(-
1000.00000000000
,
1.00030600000
);
meanAtmosphericRefractions
.
put
(
0.00000000000
,
1.00027800000
);
meanAtmosphericRefractions
.
put
(
1000.00000000000
,
1.00025200000
);
meanAtmosphericRefractions
.
put
(
3000.00000000000
,
1.00020600000
);
meanAtmosphericRefractions
.
put
(
5000.00000000000
,
1.00016700000
);
meanAtmosphericRefractions
.
put
(
7000.00000000000
,
1.00013400000
);
meanAtmosphericRefractions
.
put
(
9000.00000000000
,
1.00010600000
);
meanAtmosphericRefractions
.
put
(
11000.00000000000
,
1.00008300000
);
meanAtmosphericRefractions
.
put
(
14000.00000000000
,
1.00005200000
);
meanAtmosphericRefractions
.
put
(
18000.00000000000
,
1.00002800000
);
meanAtmosphericRefractions
.
put
(
23000.00000000000
,
1.00001200000
);
meanAtmosphericRefractions
.
put
(
30000.00000000000
,
1.00000400000
);
meanAtmosphericRefractions
.
put
(
40000.00000000000
,
1.00000100000
);
meanAtmosphericRefractions
.
put
(
50000.00000000000
,
1.00000000000
);
meanAtmosphericRefractions
.
put
(
100000.00000000000
,
1.00000000000
);
Map
<
Double
,
ExtendedEllipsoid
>
atmosphericEllipsoids
=
new
HashMap
<
Double
,
ExtendedEllipsoid
>();
for
(
Double
altitude
:
meanAtmosphericRefractions
.
keySet
())
{
OneAxisEllipsoid
ellipsoid
=
new
OneAxisEllipsoid
(
Constants
.
WGS84_EARTH_EQUATORIAL_RADIUS
+
altitude
,
Constants
.
WGS84_EARTH_FLATTENING
,
FramesFactory
.
getITRF
(
IERSConventions
.
IERS_2010
,
true
));
ellipsoid
=
new
ExtendedEllipsoid
(
ellipsoid
.
getEquatorialRadius
(),
ellipsoid
.
getFlattening
(),
ellipsoid
.
getBodyFrame
());
atmosphericEllipsoids
.
put
(
altitude
,
(
ExtendedEllipsoid
)
ellipsoid
);
}
atmosphericEllipsoids
=
Collections
.
unmodifiableMap
(
ellipsoids
);
}
@Override
public
NormalizedGeodeticPoint
getPointOnGround
(
Vector3D
initialPos
,
Vector3D
initialLos
,
Vector3D
initialZenith
,
double
altitude
,
Tile
tile
)
{
NormalizedGeodeticPoint
newGeodeticPoint
=
null
;
try
{
Vector3D
pos
=
initialPos
;
Vector3D
los
=
initialLos
;
Vector3D
zenith
=
initialZenith
;
double
theta1
=
Vector3D
.
angle
(
los
,
zenith
),
theta2
;
double
previousRefractionIndex
=
-
1
;
NormalizedGeodeticPoint
gp
=
null
;
for
(
Map
.
Entry
<
Double
,
Double
>
entry
:
meanAtmosphericRefractions
.
entrySet
())
{
if
(
pos
.
getZ
()
<
entry
.
getKey
())
{
continue
;
}
double
altitude
,
Tile
tile
)
throws
RuggedException
{
Vector3D
pos
=
initialPos
;
Vector3D
los
=
initialLos
;
Vector3D
zenith
=
initialZenith
;
double
theta1
=
Vector3D
.
angle
(
los
,
zenith
),
theta2
;
double
previousRefractionIndex
=
-
1
;
NormalizedGeodeticPoint
gp
=
null
;
for
(
Map
.
Entry
<
Double
,
Double
>
entry
:
meanAtmosphericRefractions
.
entrySet
())
{
if
(
pos
.
getZ
()
<
entry
.
getKey
())
{
continue
;
}
if
(
previousRefractionIndex
>
0
)
{
theta2
=
FastMath
.
asin
(
previousRefractionIndex
*
FastMath
.
sin
(
theta1
)
/
entry
.
getValue
());
if
(
previousRefractionIndex
>
0
)
{
theta2
=
FastMath
.
asin
(
previousRefractionIndex
*
FastMath
.
sin
(
theta1
)
/
entry
.
getValue
());
// get los
double
a
=
FastMath
.
sqrt
((
1
-
FastMath
.
pow
(
FastMath
.
cos
(
theta2
),
2
))
/
(
1
-
FastMath
.
pow
(
FastMath
.
cos
(
theta1
),
2
)));
double
b
=
a
*
FastMath
.
cos
(
theta1
)
-
FastMath
.
cos
(
theta2
);
los
=
new
Vector3D
(
a
,
los
,
b
,
zenith
);
// get los
double
a
=
FastMath
.
sqrt
((
1
-
FastMath
.
pow
(
FastMath
.
cos
(
theta2
),
2
))
/
(
1
-
FastMath
.
pow
(
FastMath
.
cos
(
theta1
),
2
)));
double
b
=
a
*
FastMath
.
cos
(
theta1
)
-
FastMath
.
cos
(
theta2
);
los
=
new
Vector3D
(
a
,
los
,
b
,
zenith
);
theta1
=
theta2
;
}
theta1
=
theta2
;
}
// get intersection point
ExtendedEllipsoid
ellipsoid
=
atmosphericEllipsoids
.
get
(
entry
.
getKey
());
gp
=
ellipsoid
.
pointOnGround
(
pos
,
los
,
0.0
);
pos
=
ellipsoid
.
transform
(
gp
);
zenith
=
gp
.
getZenith
();
// get intersection point
ExtendedEllipsoid
ellipsoid
=
atmosphericEllipsoids
.
get
(
entry
.
getKey
());
gp
=
ellipsoid
.
pointOnGround
(
pos
,
los
,
0.0
);
pos
=
ellipsoid
.
transform
(
gp
);
zenith
=
gp
.
getZenith
();
if
(
altitude
>
entry
.
getKey
())
{
break
;
}
previousRefractionIndex
=
entry
.
getValue
();
if
(
altitude
>
entry
.
getKey
())
{
break
;
}
newGeodeticPoint
=
tile
.
cellIntersection
(
gp
,
los
,
0
,
0
);
}
catch
(
RuggedException
e
)
{
e
.
printStackTrace
();
previousRefractionIndex
=
entry
.
getValue
();
}
NormalizedGeodeticPoint
newGeodeticPoint
=
tile
.
cellIntersection
(
gp
,
los
,
0
,
0
);
return
newGeodeticPoint
;
}
}
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