Commit 2925314e authored by Bryan Cazabonne's avatar Bryan Cazabonne

Added weather model Global Pressure and Temperature.

parent 67bbcad4
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="TBD" date="TBD" description="TBD">
<action dev="bryan" type="add" issue="511">
Added weather model Global Pressure and Temperature.
</action>
<action dev="luc" type="fix" issue="508">
Fixed inconsistency leading to inaccuracies in conversions from AbsoluteDate to FieldAbsoluteDate.
</action>
......
......@@ -114,6 +114,7 @@ import org.orekit.models.earth.DiscreteTroposphericModel;
import org.orekit.models.earth.EarthITU453AtmosphereRefraction;
import org.orekit.models.earth.EstimatedTroposphericModel;
import org.orekit.models.earth.GlobalMappingFunctionModel;
import org.orekit.models.earth.GlobalPressureTemperatureModel;
import org.orekit.models.earth.IonosphericModel;
import org.orekit.models.earth.KlobucharIonoCoefficientsLoader;
import org.orekit.models.earth.KlobucharIonoModel;
......@@ -236,7 +237,7 @@ public class OrbitDeterminationTest {
//test on the convergence
final int numberOfIte = 3;
final int numberOfEval = 5;
final int numberOfEval = 4;
Assert.assertEquals(numberOfIte, odGNSS.getNumberOfIteration());
Assert.assertEquals(numberOfEval, odGNSS.getNumberOfEvaluation());
......@@ -1099,6 +1100,7 @@ public class OrbitDeterminationTest {
final boolean[] stationZenithDelayEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_DELAY_ESTIMATED);
final boolean[] stationGlobalMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_GLOBAL_MAPPING_FUNCTION);
final boolean[] stationNiellMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_NIELL_MAPPING_FUNCTION);
final boolean[] stationWeatherEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_WEATHER_ESTIMATED);
final boolean[] stationRangeTropospheric = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_TROPOSPHERIC_CORRECTION);
//final boolean[] stationIonosphericCorrection = parser.getBooleanArray(ParameterKey.GROUND_STATION_IONOSPHERIC_CORRECTION);
......@@ -1272,7 +1274,21 @@ public class OrbitDeterminationTest {
DiscreteTroposphericModel troposphericModel;
if (stationTroposphericModelEstimated[i] && mappingModel != null) {
troposphericModel = new EstimatedTroposphericModel(mappingModel, stationTroposphericZenithDelay[i]);
if(stationWeatherEstimated[i]) {
final GlobalPressureTemperatureModel weather = new GlobalPressureTemperatureModel(stationLatitudes[i],
stationLongitudes[i],
body.getBodyFrame());
weather.computeTemperatureAndPressure(stationAltitudes[i], parser.getDate(ParameterKey.ORBIT_DATE,
TimeScalesFactory.getUTC()));
final double temperature = weather.getTemperature();
final double pressure = weather.getPressure();
troposphericModel = new EstimatedTroposphericModel(temperature, pressure, mappingModel,
stationTroposphericZenithDelay[i]);
} else {
troposphericModel = new EstimatedTroposphericModel(mappingModel, stationTroposphericZenithDelay[i]);
}
ParameterDriver totalDelay = troposphericModel.getParametersDrivers().get(0);
totalDelay.setSelected(stationZenithDelayEstimated[i]);
totalDelay.setName(stationNames[i].substring(0, 5) + EstimatedTroposphericModel.TOTAL_ZENITH_DELAY);
......@@ -2414,6 +2430,7 @@ public class OrbitDeterminationTest {
GROUND_STATION_TROPOSPHERIC_DELAY_ESTIMATED,
GROUND_STATION_GLOBAL_MAPPING_FUNCTION,
GROUND_STATION_NIELL_MAPPING_FUNCTION,
GROUND_STATION_WEATHER_ESTIMATED,
GROUND_STATION_RANGE_SIGMA,
GROUND_STATION_RANGE_BIAS,
GROUND_STATION_RANGE_BIAS_MIN,
......
......@@ -111,6 +111,7 @@ import org.orekit.models.earth.DiscreteTroposphericModel;
import org.orekit.models.earth.EarthITU453AtmosphereRefraction;
import org.orekit.models.earth.EstimatedTroposphericModel;
import org.orekit.models.earth.GlobalMappingFunctionModel;
import org.orekit.models.earth.GlobalPressureTemperatureModel;
import org.orekit.models.earth.IonosphericModel;
import org.orekit.models.earth.KlobucharIonoCoefficientsLoader;
import org.orekit.models.earth.KlobucharIonoModel;
......@@ -1609,6 +1610,7 @@ public class KalmanOrbitDeterminationTest {
final boolean[] stationZenithDelayEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_TROPOSPHERIC_DELAY_ESTIMATED);
final boolean[] stationGlobalMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_GLOBAL_MAPPING_FUNCTION);
final boolean[] stationNiellMappingFunction = parser.getBooleanArray(ParameterKey.GROUND_STATION_NIELL_MAPPING_FUNCTION);
final boolean[] stationWeatherEstimated = parser.getBooleanArray(ParameterKey.GROUND_STATION_WEATHER_ESTIMATED);
final boolean[] stationRangeTropospheric = parser.getBooleanArray(ParameterKey.GROUND_STATION_RANGE_TROPOSPHERIC_CORRECTION);
//final boolean[] stationIonosphericCorrection = parser.getBooleanArray(ParameterKey.GROUND_STATION_IONOSPHERIC_CORRECTION);
......@@ -1782,7 +1784,21 @@ public class KalmanOrbitDeterminationTest {
final DiscreteTroposphericModel troposphericModel;
if (stationTroposphericModelEstimated[i] && mappingModel != null) {
troposphericModel = new EstimatedTroposphericModel(mappingModel, stationTroposphericZenithDelay[i]);
if(stationWeatherEstimated[i]) {
final GlobalPressureTemperatureModel weather = new GlobalPressureTemperatureModel(stationLatitudes[i],
stationLongitudes[i],
body.getBodyFrame());
weather.computeTemperatureAndPressure(stationAltitudes[i], parser.getDate(ParameterKey.ORBIT_DATE,
TimeScalesFactory.getUTC()));
final double temperature = weather.getTemperature();
final double pressure = weather.getPressure();
troposphericModel = new EstimatedTroposphericModel(temperature, pressure, mappingModel,
stationTroposphericZenithDelay[i]);
} else {
troposphericModel = new EstimatedTroposphericModel(mappingModel, stationTroposphericZenithDelay[i]);
}
ParameterDriver totalDelay = troposphericModel.getParametersDrivers().get(0);
totalDelay.setSelected(stationZenithDelayEstimated[i]);
totalDelay.setName(stationNames[i].substring(0, 5) + EstimatedTroposphericModel.TOTAL_ZENITH_DELAY);
......@@ -2851,6 +2867,7 @@ public class KalmanOrbitDeterminationTest {
GROUND_STATION_TROPOSPHERIC_MODEL_ESTIMATED,
GROUND_STATION_GLOBAL_MAPPING_FUNCTION,
GROUND_STATION_NIELL_MAPPING_FUNCTION,
GROUND_STATION_WEATHER_ESTIMATED,
GROUND_STATION_TROPOSPHERIC_ZENITH_DELAY,
GROUND_STATION_TROPOSPHERIC_DELAY_ESTIMATED,
GROUND_STATION_RANGE_SIGMA,
......
/* Copyright 2002-2018 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (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;
import org.hipparchus.util.FastMath;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.orekit.Utils;
import org.orekit.errors.OrekitException;
import org.orekit.forces.gravity.potential.GRGSFormatReader;
import org.orekit.forces.gravity.potential.GravityFieldFactory;
import org.orekit.frames.FramesFactory;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.IERSConventions;
public class GlobalPressureTemperatureModelTest {
@Before
public void setUp() throws OrekitException {
Utils.setDataRoot("regular-data:potential");
GravityFieldFactory.addPotentialCoefficientsReader(new GRGSFormatReader("grim4s4_gr", true));
}
@Test
public void testParameterComputation() {
// Site Toulouse, Cité de l'Espace (France): latitude: 43.59°N
// longitude: 1.49°E
// height: 140 m
//
// Date: 09 January 2019 at 0h UT
//
// Expected outputs are obtained by performing the Matlab script gpt.m provided by TU WIEN:
// http://vmf.geo.tuwien.ac.at/codes/
//
// Expected parameters : temperature -> 7.3311 °C
// pressure -> 1010.2749 hPa
//
// The real weather conditions are obtained with www.infoclimat.fr
//
// Real weather conditions: temperature -> 7.3 °C
// pressure -> 1027.5 hPa
final AbsoluteDate date = new AbsoluteDate(2019, 1, 8, 0, 0, 0.0, TimeScalesFactory.getUTC());
final double latitude = FastMath.toRadians(43.59);
final double longitude = FastMath.toRadians(1.49);
final double height = 140.0;
// Given by the model
final double expectedTemperature = 7.3311;
final double expectedPressure = 1010.2749;
final GlobalPressureTemperatureModel model = new GlobalPressureTemperatureModel(latitude, longitude,
FramesFactory.getITRF(IERSConventions.IERS_2010, true));
model.computeTemperatureAndPressure(height, date);
final double computedTemperature = model.getTemperature() - 273.15;
final double computedPressure = model.getPressure();
Assert.assertEquals(expectedPressure, computedPressure, 0.1);
Assert.assertEquals(expectedTemperature, computedTemperature, 0.1);
// Real weather conditions
final double realTemperature = 7.3;
final double realPressure = 1027.5;
// We test the model accuracy (10°C and 20 hPa)
Assert.assertEquals(realTemperature, computedTemperature, 10);
Assert.assertEquals(realPressure, computedPressure, 20);
}
@Test
public void testHighAltitude() {
// Site Pic du Midi de Bigorre (France): latitude: 42.94°N
// longitude: 0.14°E
// height: 2877 m
//
// Date: 09 January 2019 at 0h UT
//
// Expected outputs are obtained by performing the Matlab script gpt.m provided by TU WIEN:
// http://vmf.geo.tuwien.ac.at/codes/
//
// Expected parameters : temperature -> -9.88 °C
// pressure -> 723.33 hPa
//
// The real weather conditions are obtained by the Laboratoire d'Aérologie de l'Observatoire Midi Pyrénées
//
// Real weather conditions: temperature -> -8.3 °C
// pressure -> 717.9 hPa
final AbsoluteDate date = new AbsoluteDate(2019, 1, 8, 0, 0, 0.0, TimeScalesFactory.getUTC());
final double latitude = FastMath.toRadians(42.94);
final double longitude = FastMath.toRadians(0.14);
final double height = 2877;
// Given by the model
final double expectedTemperature = -9.88;
final double expectedPressure = 723.33;
final GlobalPressureTemperatureModel model = new GlobalPressureTemperatureModel(latitude, longitude,
FramesFactory.getITRF(IERSConventions.IERS_2010, true));
model.computeTemperatureAndPressure(height, date);
final double computedTemperature = model.getTemperature() - 273.15;
final double computedPressure = model.getPressure();
Assert.assertEquals(expectedPressure, computedPressure, 0.1);
Assert.assertEquals(expectedTemperature, computedTemperature, 0.1);
// Real weather conditions
final double realTemperature = -8.3;
final double realPressure = 717.9;
// We test the model accuracy (10°C and 20 hPa)
Assert.assertEquals(realTemperature, computedTemperature, 10);
Assert.assertEquals(realPressure, computedPressure, 20);
}
}
......@@ -149,6 +149,7 @@ ground.station.tropospheric.delay.estimated [0] = true
ground.station.global.mapping.function [0] = false
ground.station.niell.mapping.function [0] = true
ground.station.range.tropospheric.correction [0] = true
ground.station.weather.estimated [0] = true
ground.station.name [1] = SHLD/C2
ground.station.latitude [1] = 41.868362882
......@@ -181,6 +182,7 @@ ground.station.tropospheric.delay.estimated [1] = true
ground.station.global.mapping.function [1] = false
ground.station.niell.mapping.function [1] = true
ground.station.range.tropospheric.correction [1] = true
ground.station.weather.estimated [1] = true
ground.station.name [2] = SHLD/P2
ground.station.latitude [2] = 41.868362882
......@@ -213,6 +215,7 @@ ground.station.tropospheric.delay.estimated [2] = true
ground.station.global.mapping.function [2] = false
ground.station.niell.mapping.function [2] = true
ground.station.range.tropospheric.correction [2] = true
ground.station.weather.estimated [2] = true
ground.station.name [3] = SEAT/C1
ground.station.latitude [3] = 47.653972656
......@@ -245,6 +248,7 @@ ground.station.tropospheric.delay.estimated [3] = true
ground.station.global.mapping.function [3] = false
ground.station.niell.mapping.function [3] = true
ground.station.range.tropospheric.correction [3] = true
ground.station.weather.estimated [3] = true
ground.station.name [4] = SEAT/C2
ground.station.latitude [4] = 47.653972656
......@@ -277,6 +281,7 @@ ground.station.tropospheric.delay.estimated [4] = true
ground.station.global.mapping.function [4] = false
ground.station.niell.mapping.function [4] = true
ground.station.range.tropospheric.correction [4] = true
ground.station.weather.estimated [4] = true
ground.station.name [5] = SEAT/P2
ground.station.latitude [5] = 47.653972656
......@@ -309,6 +314,7 @@ ground.station.tropospheric.delay.estimated [5] = true
ground.station.global.mapping.function [5] = false
ground.station.niell.mapping.function [5] = true
ground.station.range.tropospheric.correction [5] = true
ground.station.weather.estimated [5] = true
ground.station.name [6] = SBCH/C1
ground.station.latitude [6] = 29.868112727
......@@ -341,6 +347,7 @@ ground.station.tropospheric.delay.estimated [6] = true
ground.station.global.mapping.function [6] = false
ground.station.niell.mapping.function [6] = true
ground.station.range.tropospheric.correction [6] = true
ground.station.weather.estimated [6] = true
ground.station.name [7] = SBCH/C2
ground.station.latitude [7] = 29.868112727
......@@ -373,6 +380,7 @@ ground.station.tropospheric.delay.estimated [7] = true
ground.station.global.mapping.function [7] = false
ground.station.niell.mapping.function [7] = true
ground.station.range.tropospheric.correction [7] = true
ground.station.weather.estimated [7] = true
ground.station.name [8] = SBCH/P2
ground.station.latitude [8] = 29.868112727
......@@ -405,6 +413,7 @@ ground.station.tropospheric.delay.estimated [8] = true
ground.station.global.mapping.function [8] = false
ground.station.niell.mapping.function [8] = true
ground.station.range.tropospheric.correction [8] = true
ground.station.weather.estimated [8] = true
ground.station.name [9] = BRIG/C1
ground.station.latitude [9] = 42.520093759
......@@ -437,6 +446,7 @@ ground.station.tropospheric.delay.estimated [9] = true
ground.station.global.mapping.function [9] = false
ground.station.niell.mapping.function [9] = true
ground.station.range.tropospheric.correction [9] = true
ground.station.weather.estimated [9] = true
ground.station.name [10] = BRIG/C2
ground.station.latitude [10] = 42.520093759
......@@ -469,6 +479,7 @@ ground.station.tropospheric.delay.estimated [10] = true
ground.station.global.mapping.function [10] = false
ground.station.niell.mapping.function [10] = true
ground.station.range.tropospheric.correction [10] = true
ground.station.weather.estimated [10] = true
ground.station.name [11] = BRIG/P2
ground.station.latitude [11] = 42.520093759
......@@ -501,6 +512,7 @@ ground.station.tropospheric.delay.estimated [11] = true
ground.station.global.mapping.function [11] = false
ground.station.niell.mapping.function [11] = true
ground.station.range.tropospheric.correction [11] = true
ground.station.weather.estimated [11] = true
ground.station.name [12] = AZBH/C1
ground.station.latitude [12] = 35.107490239
......@@ -533,6 +545,7 @@ ground.station.tropospheric.delay.estimated [12] = true
ground.station.global.mapping.function [12] = false
ground.station.niell.mapping.function [12] = true
ground.station.range.tropospheric.correction [12] = true
ground.station.weather.estimated [12] = true
ground.station.name [13] = AZBH/C2
ground.station.latitude [13] = 35.107490239
......@@ -565,6 +578,7 @@ ground.station.tropospheric.delay.estimated [13] = true
ground.station.global.mapping.function [13] = false
ground.station.niell.mapping.function [13] = true
ground.station.range.tropospheric.correction [13] = true
ground.station.weather.estimated [13] = true
ground.station.name [14] = AZBH/P2
ground.station.latitude [14] = 35.107490239
......@@ -597,6 +611,7 @@ ground.station.tropospheric.delay.estimated [14] = true
ground.station.global.mapping.function [14] = false
ground.station.niell.mapping.function [14] = true
ground.station.range.tropospheric.correction [14] = true
ground.station.weather.estimated [14] = true
### Measurements parameters
range.outlier.rejection.multiplier = 6
......
......@@ -162,6 +162,7 @@ ground.station.tropospheric.delay.estimated [0] = false
ground.station.global.mapping.function [0] = false
ground.station.niell.mapping.function [0] = false
ground.station.range.tropospheric.correction [0] = true
ground.station.weather.estimated [0] = false
ground.station.name [1] = GODL
ground.station.latitude [1] = 39.020605
......@@ -194,6 +195,7 @@ ground.station.tropospheric.delay.estimated [1] = false
ground.station.global.mapping.function [1] = false
ground.station.niell.mapping.function [1] = false
ground.station.range.tropospheric.correction [1] = true
ground.station.weather.estimated [1] = false
ground.station.name [2] = HA4T
ground.station.latitude [2] = 20.706489
......@@ -226,6 +228,7 @@ ground.station.tropospheric.delay.estimated [2] = false
ground.station.global.mapping.function [2] = false
ground.station.niell.mapping.function [2] = false
ground.station.range.tropospheric.correction [2] = true
ground.station.weather.estimated [2] = false
ground.station.name [3] = SISL
ground.station.latitude [3] = 33.577694
......@@ -258,6 +261,7 @@ ground.station.tropospheric.delay.estimated [3] = false
ground.station.global.mapping.function [3] = false
ground.station.niell.mapping.function [3] = false
ground.station.range.tropospheric.correction [3] = true
ground.station.weather.estimated [3] = false
......
......@@ -218,6 +218,7 @@ ground.station.tropospheric.delay.estimated [0] = false
ground.station.global.mapping.function [0] = false
ground.station.niell.mapping.function [0] = false
ground.station.range.tropospheric.correction [0] = true
ground.station.weather.estimated [0] = false
ground.station.name [1] = Kumsan
ground.station.latitude [1] = 36.1247623774
......@@ -250,6 +251,7 @@ ground.station.tropospheric.delay.estimated [1] = false
ground.station.global.mapping.function [1] = false
ground.station.niell.mapping.function [1] = false
ground.station.range.tropospheric.correction [1] = true
ground.station.weather.estimated [1] = false
ground.station.name [2] = Uralla
ground.station.latitude [2] = -30.632947613
......@@ -282,6 +284,7 @@ ground.station.tropospheric.delay.estimated [2] = false
ground.station.global.mapping.function [2] = false
ground.station.niell.mapping.function [2] = false
ground.station.range.tropospheric.correction [2] = true
ground.station.weather.estimated [2] = false
ground.station.name [3] = Pretoria
ground.station.latitude [3] = -25.8854896226
......@@ -314,6 +317,7 @@ ground.station.tropospheric.delay.estimated [3] = false
ground.station.global.mapping.function [3] = false
ground.station.niell.mapping.function [3] = false
ground.station.range.tropospheric.correction [3] = true
ground.station.weather.estimated [3] = false
ground.station.name [4] = CastleRock
ground.station.latitude [4] = 39.2764477379
......@@ -346,6 +350,7 @@ ground.station.tropospheric.delay.estimated [4] = false
ground.station.global.mapping.function [4] = false
ground.station.niell.mapping.function [4] = false
ground.station.range.tropospheric.correction [4] = true
ground.station.weather.estimated [4] = false
### Measurements parameters
range.outlier.rejection.multiplier = 6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment