Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Orekit
Orekit
Commits
623196b1
Commit
623196b1
authored
Feb 22, 2021
by
Bryan Cazabonne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved duplicated methods into one utility class.
parent
3f6502d7
Pipeline
#912
passed with stage
in 24 minutes and 35 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
151 additions
and
320 deletions
+151
-320
src/main/java/org/orekit/models/earth/troposphere/GlobalMappingFunctionModel.java
.../models/earth/troposphere/GlobalMappingFunctionModel.java
+6
-96
src/main/java/org/orekit/models/earth/troposphere/NiellMappingFunctionModel.java
...t/models/earth/troposphere/NiellMappingFunctionModel.java
+8
-85
src/main/java/org/orekit/models/earth/troposphere/TroposphericModelUtils.java
...ekit/models/earth/troposphere/TroposphericModelUtils.java
+127
-0
src/main/java/org/orekit/models/earth/troposphere/ViennaOneModel.java
...a/org/orekit/models/earth/troposphere/ViennaOneModel.java
+6
-96
src/main/java/org/orekit/models/earth/troposphere/ViennaThreeModel.java
...org/orekit/models/earth/troposphere/ViennaThreeModel.java
+4
-43
No files found.
src/main/java/org/orekit/models/earth/troposphere/GlobalMappingFunctionModel.java
View file @
623196b1
...
...
@@ -166,11 +166,11 @@ public class GlobalMappingFunctionModel implements MappingFunction {
final
double
aw
=
a0Wet
+
amplWet
*
FastMath
.
cos
(
coef
-
psi
);
final
double
[]
function
=
new
double
[
2
];
function
[
0
]
=
compute
Function
(
ah
,
bh
,
ch
,
elevation
);
function
[
1
]
=
compute
Function
(
aw
,
bw
,
cw
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
ah
,
bh
,
ch
,
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
aw
,
bw
,
cw
,
elevation
);
// Apply height correction
final
double
correction
=
computeHeightCorrection
(
elevation
,
point
.
getAltitude
());
final
double
correction
=
TroposphericModelUtils
.
computeHeightCorrection
(
elevation
,
point
.
getAltitude
());
function
[
0
]
=
function
[
0
]
+
correction
;
return
function
;
...
...
@@ -265,11 +265,11 @@ public class GlobalMappingFunctionModel implements MappingFunction {
final
T
aw
=
a0Wet
.
add
(
amplWet
.
multiply
(
FastMath
.
cos
(
coef
.
subtract
(
psi
))));
final
T
[]
function
=
MathArrays
.
buildArray
(
field
,
2
);
function
[
0
]
=
compute
Function
(
ah
,
bh
,
ch
,
elevation
);
function
[
1
]
=
compute
Function
(
aw
,
bw
,
cw
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
ah
,
bh
,
ch
,
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
aw
,
bw
,
cw
,
elevation
);
// Apply height correction
final
T
correction
=
computeHeightCorrection
(
elevation
,
point
.
getAltitude
(),
field
);
final
T
correction
=
TroposphericModelUtils
.
computeHeightCorrection
(
elevation
,
point
.
getAltitude
(),
field
);
function
[
0
]
=
function
[
0
].
add
(
correction
);
return
function
;
...
...
@@ -281,96 +281,6 @@ public class GlobalMappingFunctionModel implements MappingFunction {
return
Collections
.
emptyList
();
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
double
computeFunction
(
final
double
a
,
final
double
b
,
final
double
c
,
final
double
elevation
)
{
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
double
numMP
=
1
+
a
/
(
1
+
b
/
(
1
+
c
));
// Denominator
final
double
denMP
=
sinE
+
a
/
(
sinE
+
b
/
(
sinE
+
c
));
final
double
fElevation
=
numMP
/
denMP
;
return
fElevation
;
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param <T> type of the elements
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeFunction
(
final
T
a
,
final
T
b
,
final
T
c
,
final
T
elevation
)
{
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
T
numMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
1.0
)).
add
(
1.0
)).
add
(
1.0
);
// Denominator
final
T
denMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
sinE
)).
add
(
sinE
)).
add
(
sinE
);
final
T
fElevation
=
numMP
.
divide
(
denMP
);
return
fElevation
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function.
* The formulas are given by Neill's paper, 1996:
*<p>
* Niell A. E. (1996)
* "Global mapping functions for the atmosphere delay of radio wavelengths,”
* J. Geophys. Res., 101(B2), pp. 3227–3246, doi: 10.1029/95JB03048.
*</p>
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @return the height correction, in m
*/
private
double
computeHeightCorrection
(
final
double
elevation
,
final
double
height
)
{
final
double
fixedHeight
=
FastMath
.
max
(
0.0
,
height
);
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
double
function
=
computeFunction
(
2.53
e
-
5
,
5.49
e
-
3
,
1.14
e
-
3
,
elevation
);
// Ref: Eq. 6
final
double
dmdh
=
(
1
/
sinE
)
-
function
;
// Ref: Eq. 7
final
double
correction
=
dmdh
*
(
fixedHeight
/
1000.0
);
return
correction
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function.
* The formulas are given by Neill's paper, 1996:
*<p>
* Niell A. E. (1996)
* "Global mapping functions for the atmosphere delay of radio wavelengths,”
* J. Geophys. Res., 101(B2), pp. 3227–3246, doi: 10.1029/95JB03048.
*</p>
* @param <T> type of the elements
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @param field field to which the elements belong
* @return the height correction, in m
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeHeightCorrection
(
final
T
elevation
,
final
T
height
,
final
Field
<
T
>
field
)
{
final
T
zero
=
field
.
getZero
();
final
T
fixedHeight
=
FastMath
.
max
(
zero
,
height
);
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
T
function
=
computeFunction
(
zero
.
add
(
2.53
e
-
5
),
zero
.
add
(
5.49
e
-
3
),
zero
.
add
(
1.14
e
-
3
),
elevation
);
// Ref: Eq. 6
final
T
dmdh
=
sinE
.
reciprocal
().
subtract
(
function
);
// Ref: Eq. 7
final
T
correction
=
dmdh
.
multiply
(
fixedHeight
.
divide
(
1000.0
));
return
correction
;
}
/** Computes the P<sub>nm</sub>(sin(Φ)) coefficients of Eq. 3 (Boehm et al, 2006).
* The computation of the Legendre polynomials is performed following:
* Heiskanen and Moritz, Physical Geodesy, 1967, eq. 1-62
...
...
src/main/java/org/orekit/models/earth/troposphere/NiellMappingFunctionModel.java
View file @
623196b1
...
...
@@ -192,13 +192,13 @@ public class NiellMappingFunctionModel implements MappingFunction {
final
double
[]
function
=
new
double
[
2
];
// Hydrostatic mapping factor
function
[
0
]
=
compute
Function
(
ah
,
bh
,
ch
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
ah
,
bh
,
ch
,
elevation
);
// Wet mapping factor
function
[
1
]
=
compute
Function
(
awFunction
.
value
(
absLatidude
),
bwFunction
.
value
(
absLatidude
),
cwFunction
.
value
(
absLatidude
),
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
awFunction
.
value
(
absLatidude
),
bwFunction
.
value
(
absLatidude
),
cwFunction
.
value
(
absLatidude
),
elevation
);
// Apply height correction
final
double
correction
=
computeHeightCorrection
(
elevation
,
point
.
getAltitude
());
final
double
correction
=
TroposphericModelUtils
.
computeHeightCorrection
(
elevation
,
point
.
getAltitude
());
function
[
0
]
=
function
[
0
]
+
correction
;
return
function
;
...
...
@@ -237,100 +237,23 @@ public class NiellMappingFunctionModel implements MappingFunction {
final
T
[]
function
=
MathArrays
.
buildArray
(
field
,
2
);
// Hydrostatic mapping factor
function
[
0
]
=
compute
Function
(
ah
,
bh
,
ch
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
ah
,
bh
,
ch
,
elevation
);
// Wet mapping factor
function
[
1
]
=
compute
Function
(
zero
.
add
(
awFunction
.
value
(
absLatidude
)),
zero
.
add
(
bwFunction
.
value
(
absLatidude
)),
zero
.
add
(
cwFunction
.
value
(
absLatidude
)),
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
zero
.
add
(
awFunction
.
value
(
absLatidude
)),
zero
.
add
(
bwFunction
.
value
(
absLatidude
)),
zero
.
add
(
cwFunction
.
value
(
absLatidude
)),
elevation
);
// Apply height correction
final
T
correction
=
computeHeightCorrection
(
elevation
,
point
.
getAltitude
(),
field
);
final
T
correction
=
TroposphericModelUtils
.
computeHeightCorrection
(
elevation
,
point
.
getAltitude
(),
field
);
function
[
0
]
=
function
[
0
].
add
(
correction
);
return
function
;
}
/** {@inheritDoc} */
@Override
public
List
<
ParameterDriver
>
getParametersDrivers
()
{
return
Collections
.
emptyList
();
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
double
computeFunction
(
final
double
a
,
final
double
b
,
final
double
c
,
final
double
elevation
)
{
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
double
numMP
=
1
+
a
/
(
1
+
b
/
(
1
+
c
));
// Denominator
final
double
denMP
=
sinE
+
a
/
(
sinE
+
b
/
(
sinE
+
c
));
final
double
felevation
=
numMP
/
denMP
;
return
felevation
;
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param <T> type of the elements
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeFunction
(
final
T
a
,
final
T
b
,
final
T
c
,
final
T
elevation
)
{
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
T
numMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
1.0
)).
add
(
1.0
)).
add
(
1.0
);
// Denominator
final
T
denMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
sinE
)).
add
(
sinE
)).
add
(
sinE
);
final
T
felevation
=
numMP
.
divide
(
denMP
);
return
felevation
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function (Neill, 1996).
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @return the height correction, in m
*/
private
double
computeHeightCorrection
(
final
double
elevation
,
final
double
height
)
{
final
double
fixedHeight
=
FastMath
.
max
(
0.0
,
height
);
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
double
function
=
computeFunction
(
2.53
e
-
5
,
5.49
e
-
3
,
1.14
e
-
3
,
elevation
);
// Ref: Eq. 6
final
double
dmdh
=
(
1
/
sinE
)
-
function
;
// Ref: Eq. 7
final
double
correction
=
dmdh
*
(
fixedHeight
/
1000.0
);
return
correction
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function (Neill, 1996).
* @param <T> type of the elements
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @param field field to which the elements belong
* @return the height correction, in m
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeHeightCorrection
(
final
T
elevation
,
final
T
height
,
final
Field
<
T
>
field
)
{
final
T
zero
=
field
.
getZero
();
final
T
fixedHeight
=
FastMath
.
max
(
zero
,
height
);
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
T
function
=
computeFunction
(
zero
.
add
(
2.53
e
-
5
),
zero
.
add
(
5.49
e
-
3
),
zero
.
add
(
1.14
e
-
3
),
elevation
);
// Ref: Eq. 6
final
T
dmdh
=
sinE
.
reciprocal
().
subtract
(
function
);
// Ref: Eq. 7
final
T
correction
=
dmdh
.
multiply
(
fixedHeight
.
divide
(
1000.0
));
return
correction
;
}
}
src/main/java/org/orekit/models/earth/troposphere/TroposphericModelUtils.java
0 → 100644
View file @
623196b1
/* Copyright 2002-2021 CS GROUP
* Licensed to CS GROUP (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.orekit.models.earth.troposphere
;
import
org.hipparchus.Field
;
import
org.hipparchus.RealFieldElement
;
import
org.hipparchus.util.FastMath
;
/**
* Utility class for tropospheric models.
* @author Bryan Cazabonne
* @since 11.0
*/
public
class
TroposphericModelUtils
{
/**
* Private constructor as class is a utility.
*/
private
TroposphericModelUtils
()
{
// Nothing to do
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
public
static
double
mappingFunction
(
final
double
a
,
final
double
b
,
final
double
c
,
final
double
elevation
)
{
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
double
numMP
=
1
+
a
/
(
1
+
b
/
(
1
+
c
));
// Denominator
final
double
denMP
=
sinE
+
a
/
(
sinE
+
b
/
(
sinE
+
c
));
final
double
fElevation
=
numMP
/
denMP
;
return
fElevation
;
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param <T> type of the elements
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
public
static
<
T
extends
RealFieldElement
<
T
>>
T
mappingFunction
(
final
T
a
,
final
T
b
,
final
T
c
,
final
T
elevation
)
{
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
T
numMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
1.0
)).
add
(
1.0
)).
add
(
1.0
);
// Denominator
final
T
denMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
sinE
)).
add
(
sinE
)).
add
(
sinE
);
final
T
fElevation
=
numMP
.
divide
(
denMP
);
return
fElevation
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function.
* The formulas are given by Neill's paper, 1996:
*<p>
* Niell A. E. (1996)
* "Global mapping functions for the atmosphere delay of radio wavelengths,”
* J. Geophys. Res., 101(B2), pp. 3227–3246, doi: 10.1029/95JB03048.
*</p>
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @return the height correction, in m
*/
public
static
double
computeHeightCorrection
(
final
double
elevation
,
final
double
height
)
{
final
double
fixedHeight
=
FastMath
.
max
(
0.0
,
height
);
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
double
function
=
TroposphericModelUtils
.
mappingFunction
(
2.53
e
-
5
,
5.49
e
-
3
,
1.14
e
-
3
,
elevation
);
// Ref: Eq. 6
final
double
dmdh
=
(
1
/
sinE
)
-
function
;
// Ref: Eq. 7
final
double
correction
=
dmdh
*
(
fixedHeight
/
1000.0
);
return
correction
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function.
* The formulas are given by Neill's paper, 1996:
*<p>
* Niell A. E. (1996)
* "Global mapping functions for the atmosphere delay of radio wavelengths,”
* J. Geophys. Res., 101(B2), pp. 3227–3246, doi: 10.1029/95JB03048.
*</p>
* @param <T> type of the elements
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @param field field to which the elements belong
* @return the height correction, in m
*/
public
static
<
T
extends
RealFieldElement
<
T
>>
T
computeHeightCorrection
(
final
T
elevation
,
final
T
height
,
final
Field
<
T
>
field
)
{
final
T
zero
=
field
.
getZero
();
final
T
fixedHeight
=
FastMath
.
max
(
zero
,
height
);
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
T
function
=
TroposphericModelUtils
.
mappingFunction
(
zero
.
add
(
2.53
e
-
5
),
zero
.
add
(
5.49
e
-
3
),
zero
.
add
(
1.14
e
-
3
),
elevation
);
// Ref: Eq. 6
final
T
dmdh
=
sinE
.
reciprocal
().
subtract
(
function
);
// Ref: Eq. 7
final
T
correction
=
dmdh
.
multiply
(
fixedHeight
.
divide
(
1000.0
));
return
correction
;
}
}
src/main/java/org/orekit/models/earth/troposphere/ViennaOneModel.java
View file @
623196b1
...
...
@@ -176,11 +176,11 @@ public class ViennaOneModel implements DiscreteTroposphericModel {
final
double
cw
=
0.04391
;
final
double
[]
function
=
new
double
[
2
];
function
[
0
]
=
compute
Function
(
coefficientsA
[
0
],
bh
,
ch
,
elevation
);
function
[
1
]
=
compute
Function
(
coefficientsA
[
1
],
bw
,
cw
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
coefficientsA
[
0
],
bh
,
ch
,
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
coefficientsA
[
1
],
bw
,
cw
,
elevation
);
// Apply height correction
final
double
correction
=
computeHeightCorrection
(
elevation
,
point
.
getAltitude
());
final
double
correction
=
TroposphericModelUtils
.
computeHeightCorrection
(
elevation
,
point
.
getAltitude
());
function
[
0
]
=
function
[
0
]
+
correction
;
return
function
;
...
...
@@ -233,11 +233,11 @@ public class ViennaOneModel implements DiscreteTroposphericModel {
final
T
cw
=
zero
.
add
(
0.04391
);
final
T
[]
function
=
MathArrays
.
buildArray
(
field
,
2
);
function
[
0
]
=
compute
Function
(
zero
.
add
(
coefficientsA
[
0
]),
bh
,
ch
,
elevation
);
function
[
1
]
=
compute
Function
(
zero
.
add
(
coefficientsA
[
1
]),
bw
,
cw
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
zero
.
add
(
coefficientsA
[
0
]),
bh
,
ch
,
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
zero
.
add
(
coefficientsA
[
1
]),
bw
,
cw
,
elevation
);
// Apply height correction
final
T
correction
=
computeHeightCorrection
(
elevation
,
point
.
getAltitude
(),
field
);
final
T
correction
=
TroposphericModelUtils
.
computeHeightCorrection
(
elevation
,
point
.
getAltitude
(),
field
);
function
[
0
]
=
function
[
0
].
add
(
correction
);
return
function
;
...
...
@@ -249,94 +249,4 @@ public class ViennaOneModel implements DiscreteTroposphericModel {
return
Collections
.
emptyList
();
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
double
computeFunction
(
final
double
a
,
final
double
b
,
final
double
c
,
final
double
elevation
)
{
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
double
numMP
=
1
+
a
/
(
1
+
b
/
(
1
+
c
));
// Denominator
final
double
denMP
=
sinE
+
a
/
(
sinE
+
b
/
(
sinE
+
c
));
final
double
felevation
=
numMP
/
denMP
;
return
felevation
;
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param <T> type of the elements
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeFunction
(
final
T
a
,
final
T
b
,
final
T
c
,
final
T
elevation
)
{
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
T
numMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
1.0
)).
add
(
1.0
)).
add
(
1.0
);
// Denominator
final
T
denMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
sinE
)).
add
(
sinE
)).
add
(
sinE
);
final
T
felevation
=
numMP
.
divide
(
denMP
);
return
felevation
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function.
* The formulas are given by Neill's paper, 1996:
*<p>
* Niell A. E. (1996)
* "Global mapping functions for the atmosphere delay of radio wavelengths,”
* J. Geophys. Res., 101(B2), pp. 3227–3246, doi: 10.1029/95JB03048.
*</p>
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @return the height correction, in m
*/
private
double
computeHeightCorrection
(
final
double
elevation
,
final
double
height
)
{
final
double
fixedHeight
=
FastMath
.
max
(
0.0
,
height
);
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
double
function
=
computeFunction
(
2.53
e
-
5
,
5.49
e
-
3
,
1.14
e
-
3
,
elevation
);
// Ref: Eq. 6
final
double
dmdh
=
(
1
/
sinE
)
-
function
;
// Ref: Eq. 7
final
double
correction
=
dmdh
*
(
fixedHeight
/
1000
);
return
correction
;
}
/** This method computes the height correction for the hydrostatic
* component of the mapping function.
* The formulas are given by Neill's paper, 1996:
*<p>
* Niell A. E. (1996)
* "Global mapping functions for the atmosphere delay of radio wavelengths,”
* J. Geophys. Res., 101(B2), pp. 3227–3246, doi: 10.1029/95JB03048.
*</p>
* @param <T> type of the elements
* @param elevation the elevation of the satellite, in radians.
* @param height the height of the station in m above sea level.
* @param field field to which the elements belong
* @return the height correction, in m
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeHeightCorrection
(
final
T
elevation
,
final
T
height
,
final
Field
<
T
>
field
)
{
final
T
zero
=
field
.
getZero
();
final
T
fixedHeight
=
FastMath
.
max
(
zero
,
height
);
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Ref: Eq. 4
final
T
function
=
computeFunction
(
zero
.
add
(
2.53
e
-
5
),
zero
.
add
(
5.49
e
-
3
),
zero
.
add
(
1.14
e
-
3
),
elevation
);
// Ref: Eq. 6
final
T
dmdh
=
sinE
.
reciprocal
().
subtract
(
function
);
// Ref: Eq. 7
final
T
correction
=
dmdh
.
multiply
(
fixedHeight
.
divide
(
1000.0
));
return
correction
;
}
}
src/main/java/org/orekit/models/earth/troposphere/ViennaThreeModel.java
View file @
623196b1
...
...
@@ -173,8 +173,8 @@ public class ViennaThreeModel implements DiscreteTroposphericModel {
// Compute Mapping Function Eq. 4
final
double
[]
function
=
new
double
[
2
];
function
[
0
]
=
compute
Function
(
coefficientsA
[
0
],
bh
,
ch
,
elevation
);
function
[
1
]
=
compute
Function
(
coefficientsA
[
1
],
bw
,
cw
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
coefficientsA
[
0
],
bh
,
ch
,
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
coefficientsA
[
1
],
bw
,
cw
,
elevation
);
return
function
;
}
...
...
@@ -261,8 +261,8 @@ public class ViennaThreeModel implements DiscreteTroposphericModel {
// Compute Mapping Function Eq. 4
final
T
[]
function
=
MathArrays
.
buildArray
(
field
,
2
);
function
[
0
]
=
compute
Function
(
zero
.
add
(
coefficientsA
[
0
]),
bh
,
ch
,
elevation
);
function
[
1
]
=
compute
Function
(
zero
.
add
(
coefficientsA
[
1
]),
bw
,
cw
,
elevation
);
function
[
0
]
=
TroposphericModelUtils
.
mapping
Function
(
zero
.
add
(
coefficientsA
[
0
]),
bh
,
ch
,
elevation
);
function
[
1
]
=
TroposphericModelUtils
.
mapping
Function
(
zero
.
add
(
coefficientsA
[
1
]),
bw
,
cw
,
elevation
);
return
function
;
}
...
...
@@ -315,45 +315,6 @@ public class ViennaThreeModel implements DiscreteTroposphericModel {
return
Collections
.
emptyList
();
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
double
computeFunction
(
final
double
a
,
final
double
b
,
final
double
c
,
final
double
elevation
)
{
final
double
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
double
numMP
=
1
+
a
/
(
1
+
b
/
(
1
+
c
));
// Denominator
final
double
denMP
=
sinE
+
a
/
(
sinE
+
b
/
(
sinE
+
c
));
final
double
felevation
=
numMP
/
denMP
;
return
felevation
;
}
/** Compute the mapping function related to the coefficient values and the elevation.
* @param <T> type of the elements
* @param a a coefficient
* @param b b coefficient
* @param c c coefficient
* @param elevation the elevation of the satellite, in radians.
* @return the value of the function at a given elevation
*/
private
<
T
extends
RealFieldElement
<
T
>>
T
computeFunction
(
final
T
a
,
final
T
b
,
final
T
c
,
final
T
elevation
)
{
final
T
sinE
=
FastMath
.
sin
(
elevation
);
// Numerator
final
T
numMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
1.0
)).
add
(
1.0
)).
add
(
1.0
);
// Denominator
final
T
denMP
=
a
.
divide
(
b
.
divide
(
c
.
add
(
sinE
)).
add
(
sinE
)).
add
(
sinE
);