Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Orekit
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
37
Issues
37
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Orekit
Orekit
Commits
39940d9e
Commit
39940d9e
authored
Jan 14, 2019
by
Bryan Cazabonne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed API for angle unit.
parent
44425e5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
src/main/java/org/orekit/models/earth/GlobalPressureTemperature2Model.java
.../orekit/models/earth/GlobalPressureTemperature2Model.java
+20
-17
src/test/java/org/orekit/models/earth/GlobalPressureTemperature2ModelTest.java
...kit/models/earth/GlobalPressureTemperature2ModelTest.java
+12
-11
No files found.
src/main/java/org/orekit/models/earth/GlobalPressureTemperature2Model.java
View file @
39940d9e
...
...
@@ -89,10 +89,10 @@ public class GlobalPressureTemperature2Model implements DataLoader, WeatherModel
/** The hydrostatic and wet a coefficients loaded. */
private
double
[]
coefficientsA
;
/** Geodetic site latitude,
degree
s.*/
/** Geodetic site latitude,
radian
s.*/
private
double
latitude
;
/** Geodetic site longitude,
degree
s.*/
/** Geodetic site longitude,
radian
s.*/
private
double
longitude
;
/** Temperature site, in kelvins. */
...
...
@@ -115,8 +115,8 @@ public class GlobalPressureTemperature2Model implements DataLoader, WeatherModel
/** Constructor with supported names given by user.
* @param supportedNames supported names
* @param latitude geodetic latitude of the station, in
degree
s
* @param longitude longitude geodetic latitude of the station, in
degree
s
* @param latitude geodetic latitude of the station, in
radian
s
* @param longitude longitude geodetic latitude of the station, in
radian
s
* @param geoid level surface of the gravity potential of a body
*/
public
GlobalPressureTemperature2Model
(
final
String
supportedNames
,
final
double
latitude
,
...
...
@@ -129,14 +129,13 @@ public class GlobalPressureTemperature2Model implements DataLoader, WeatherModel
this
.
geoid
=
geoid
;
this
.
latitude
=
latitude
;
// Normalize longitude between 0° and 360°
final
double
lon
=
MathUtils
.
normalizeAngle
(
FastMath
.
toRadians
(
longitude
),
FastMath
.
PI
);
this
.
longitude
=
FastMath
.
toDegrees
(
lon
);
// Normalize longitude between 0 and 2π
this
.
longitude
=
MathUtils
.
normalizeAngle
(
longitude
,
FastMath
.
PI
);
}
/** Constructor with default supported names.
* @param latitude geodetic latitude of the station, in
degree
s
* @param longitude geodetic latitude of the station, in
degree
s
* @param latitude geodetic latitude of the station, in
radian
s
* @param longitude geodetic latitude of the station, in
radian
s
* @param geoid level surface of the gravity potential of a body
*/
public
GlobalPressureTemperature2Model
(
final
double
latitude
,
final
double
longitude
,
final
Geoid
geoid
)
{
...
...
@@ -307,30 +306,34 @@ public class GlobalPressureTemperature2Model implements DataLoader, WeatherModel
final
BilinearInterpolatingFunction
functionAH
=
new
BilinearInterpolatingFunction
(
xVal
,
yVal
,
fvalAH
);
final
BilinearInterpolatingFunction
functionAW
=
new
BilinearInterpolatingFunction
(
xVal
,
yVal
,
fvalAW
);
// Convert geodetic coordinates to degrees
final
double
lat
=
FastMath
.
toDegrees
(
latitude
);
final
double
lon
=
FastMath
.
toDegrees
(
longitude
);
// ah and aw coefficients
coefficientsA
=
new
double
[
2
];
coefficientsA
[
0
]
=
functionAH
.
value
(
lat
itude
,
longitude
)
*
0.001
;
coefficientsA
[
1
]
=
functionAW
.
value
(
lat
itude
,
longitude
)
*
0.001
;
coefficientsA
[
0
]
=
functionAH
.
value
(
lat
,
lon
)
*
0.001
;
coefficientsA
[
1
]
=
functionAW
.
value
(
lat
,
lon
)
*
0.001
;
// Corrected height (can be negative)
final
double
undu
=
geoid
.
getUndulation
(
lat
itude
,
longitude
,
date
);
final
double
correctedheight
=
height
-
undu
-
functionHS
.
value
(
lat
itude
,
longitude
);
final
double
undu
=
geoid
.
getUndulation
(
lat
,
lon
,
date
);
final
double
correctedheight
=
height
-
undu
-
functionHS
.
value
(
lat
,
lon
);
// Temperature gradient [K/m]
final
double
dTdH
=
functiondT
.
value
(
lat
itude
,
longitude
)
*
0.001
;
final
double
dTdH
=
functiondT
.
value
(
lat
,
lon
)
*
0.001
;
// Specific humidity
final
double
qv
=
functionqv0
.
value
(
lat
itude
,
longitude
)
*
0.001
;
final
double
qv
=
functionqv0
.
value
(
lat
,
lon
)
*
0.001
;
// For the computation of the temperature and the pressure, we use
// the standard ICAO atmosphere formulas.
// Temperature [K]
final
double
t0
=
functionTemperature0
.
value
(
lat
itude
,
longitude
);
final
double
t0
=
functionTemperature0
.
value
(
lat
,
lon
);
this
.
temperature
=
t0
+
dTdH
*
correctedheight
;
// Pressure [hPa]
final
double
p0
=
functionPressure0
.
value
(
lat
itude
,
longitude
);
final
double
p0
=
functionPressure0
.
value
(
lat
,
lon
);
final
double
exponent
=
G
/
(
dTdH
*
R
);
this
.
pressure
=
p0
*
FastMath
.
pow
(
1
-
(
dTdH
/
t0
)
*
correctedheight
,
exponent
)
*
0.01
;
...
...
src/test/java/org/orekit/models/earth/GlobalPressureTemperature2ModelTest.java
View file @
39940d9e
...
...
@@ -16,6 +16,7 @@
*/
package
org
.
orekit
.
models
.
earth
;
import
org.hipparchus.util.FastMath
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -58,8 +59,8 @@ public class GlobalPressureTemperature2ModelTest {
// We test the fiability of our implementation by comparing our output values with
// the ones obtained by the Vienna University.
final
double
latitude
=
48.20
;
final
double
longitude
=
16.37
;
final
double
latitude
=
FastMath
.
toRadians
(
48.20
)
;
final
double
longitude
=
FastMath
.
toRadians
(
16.37
)
;
final
double
height
=
156.0
;
final
AbsoluteDate
date
=
AbsoluteDate
.
createMJDDate
(
56141
,
0.0
,
TimeScalesFactory
.
getUTC
());
final
Geoid
geoid
=
new
Geoid
(
GravityFieldFactory
.
getNormalizedProvider
(
12
,
12
),
...
...
@@ -90,7 +91,7 @@ public class GlobalPressureTemperature2ModelTest {
ReferenceEllipsoid
.
getWgs84
(
FramesFactory
.
getITRF
(
IERSConventions
.
IERS_2010
,
true
)));
final
AbsoluteDate
date
=
AbsoluteDate
.
createMJDDate
(
56141
,
0.0
,
TimeScalesFactory
.
getUTC
());
final
double
latitude
=
45.0
;
final
double
latitude
=
FastMath
.
toRadians
(
45.0
)
;
final
double
height
=
0.0
;
double
longitude1
;
...
...
@@ -100,8 +101,8 @@ public class GlobalPressureTemperature2ModelTest {
GlobalPressureTemperature2Model
model2
;
// Test longitude = 181° and longitude = -179°
longitude1
=
181.0
;
longitude2
=
-
179.0
;
longitude1
=
FastMath
.
toRadians
(
181.0
)
;
longitude2
=
FastMath
.
toRadians
(-
179.0
)
;
model1
=
new
GlobalPressureTemperature2Model
(
latitude
,
longitude1
,
geoid
);
model2
=
new
GlobalPressureTemperature2Model
(
latitude
,
longitude2
,
geoid
);
...
...
@@ -117,8 +118,8 @@ public class GlobalPressureTemperature2ModelTest {
Assert
.
assertEquals
(
model1
.
getA
()[
1
],
model2
.
getA
()[
1
],
epsilon
);
// Test longitude = 180° and longitude = -180°
longitude1
=
180.0
;
longitude2
=
-
180.0
;
longitude1
=
FastMath
.
toRadians
(
180.0
)
;
longitude2
=
FastMath
.
toRadians
(-
180.0
)
;
model1
=
new
GlobalPressureTemperature2Model
(
latitude
,
longitude1
,
geoid
);
model2
=
new
GlobalPressureTemperature2Model
(
latitude
,
longitude2
,
geoid
);
...
...
@@ -133,8 +134,8 @@ public class GlobalPressureTemperature2ModelTest {
Assert
.
assertEquals
(
model1
.
getA
()[
1
],
model2
.
getA
()[
1
],
epsilon
);
// Test longitude = 0° and longitude = 360°
longitude1
=
0.0
;
longitude2
=
360.0
;
longitude1
=
FastMath
.
toRadians
(
0.0
)
;
longitude2
=
FastMath
.
toRadians
(
360.0
)
;
model1
=
new
GlobalPressureTemperature2Model
(
latitude
,
longitude1
,
geoid
);
model2
=
new
GlobalPressureTemperature2Model
(
latitude
,
longitude2
,
geoid
);
...
...
@@ -153,8 +154,8 @@ public class GlobalPressureTemperature2ModelTest {
@Test
public
void
testCorruptedFileBadData
()
{
final
double
latitude
=
14.0
;
final
double
longitude
=
67.5
;
final
double
latitude
=
FastMath
.
toRadians
(
14.0
)
;
final
double
longitude
=
FastMath
.
toRadians
(
67.5
)
;
final
double
height
=
0.0
;
// Date is not used here
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment