Search in sources :

Example 1 with SolarInputs97to05

use of org.orekit.SolarInputs97to05 in project Orekit by CS-SI.

the class DTM2000Test method testWithOriginalTestsCases.

@Test
public void testWithOriginalTestsCases() throws OrekitException {
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
    OneAxisEllipsoid earth = new OneAxisEllipsoid(6378136.460, 1.0 / 298.257222101, itrf);
    SolarInputs97to05 in = SolarInputs97to05.getInstance();
    earth.setAngularThreshold(1e-10);
    DTM2000 atm = new DTM2000(in, sun, earth);
    double roTestCase;
    double myRo;
    // Inputs :
    // alt=800.
    // lat=40.
    // day=185.
    // hl=16.
    // xlon=0.
    // fm(1)=150.
    // f(1) =fm(1)
    // fm(2)=0.
    // f(2)=0.
    // akp(1)=0.
    // akp(2)=0.
    // akp(3)=0.
    // akp(4)=0.
    // Outputs :
    roTestCase = 1.8710001353820e-17 * 1000;
    // Computation and results
    myRo = atm.getDensity(185, 800 * 1000, 0, FastMath.toRadians(40), 16 * FastMath.PI / 12, 150, 150, 0, 0);
    Assert.assertEquals(roTestCase, myRo, roTestCase * 1e-14);
    // IDEM., day=275
    roTestCase = 2.8524195214905e-17 * 1000;
    myRo = atm.getDensity(275, 800 * 1000, 0, FastMath.toRadians(40), 16 * FastMath.PI / 12, 150, 150, 0, 0);
    Assert.assertEquals(roTestCase, myRo, roTestCase * 1e-14);
    // IDEM., day=355
    roTestCase = 1.7343324462212e-17 * 1000;
    myRo = atm.getDensity(355, 800 * 1000, 0, FastMath.toRadians(40), 16 * FastMath.PI / 12, 150, 150, 0, 0);
    Assert.assertEquals(roTestCase, myRo, roTestCase * 2e-14);
    // IDEM., day=85
    roTestCase = 2.9983740796297e-17 * 1000;
    myRo = atm.getDensity(85, 800 * 1000, 0, FastMath.toRadians(40), 16 * FastMath.PI / 12, 150, 150, 0, 0);
    Assert.assertEquals(roTestCase, myRo, roTestCase * 1e-14);
    // alt=500.
    // lat=-70.      NB: the subroutine requires latitude in rad
    // day=15.
    // hl=16.        NB: the subroutine requires local time in rad (0hr=0 rad)
    // xlon=0.
    // fm(1)=70.
    // f(1) =fm(1)
    // fm(2)=0.
    // f(2)=0.
    // akp(1)=0.
    // akp(2)=0.
    // akp(3)=0.
    // akp(4)=0.
    // ro=    1.3150282384722D-16
    // tz=    793.65487014559
    // tinf=    793.65549802348
    // note that the values above are the ones present in the original fortran source comments
    // however, running this original source (converted to double precision) does
    // not yield the results in the comments, but instead gives the following results
    // as all the other tests cases do behave correctly, we assume the comments are wrong
    // and prefer to ensure we get the same result as the original CODE
    // as we don't have access to any other tests cases, we can't really decide if this is
    // the best approach. Indeed, we are able to get the same results as original fortran
    roTestCase = 1.5699108952425600E-016 * 1000;
    myRo = atm.getDensity(15, 500 * 1000, 0, FastMath.toRadians(-70), 16 * FastMath.PI / 12, 70, 70, 0, 0);
    Assert.assertEquals(roTestCase, myRo, roTestCase * 1e-14);
    // IDEM., alt=800.
    // ro=    1.9556768571305D-18
    // tz=    793.65549797919
    // tinf=    793.65549802348
    // note that the values above are the ones present in the original fortran source comments
    // however, running this original source (converted to double precision) does
    // not yield the results in the comments, but instead gives the following results
    // as all the other tests cases do behave correctly, we assume the comments are wrong
    // and prefer to ensure we get the same result as the original CODE
    // as we don't have access to any other tests cases, we can't really decide if this is
    // the best approach. Indeed, we are able to get the same results as original fortran
    roTestCase = 2.4123751406975562E-018 * 1000;
    myRo = atm.getDensity(15, 800 * 1000, 0, FastMath.toRadians(-70), 16 * FastMath.PI / 12, 70, 70, 0, 0);
    Assert.assertEquals(roTestCase, myRo, roTestCase * 1e-14);
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) SolarInputs97to05(org.orekit.SolarInputs97to05) Test(org.junit.Test)

Example 2 with SolarInputs97to05

use of org.orekit.SolarInputs97to05 in project Orekit by CS-SI.

the class DTM2000Test method testNonEarthRotationAxisAlignedFrame.

@Test
public void testNonEarthRotationAxisAlignedFrame() throws OrekitException {
    // setup
    AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
    Frame ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Rotation rotation = new Rotation(Vector3D.PLUS_I, FastMath.PI / 2, RotationConvention.VECTOR_OPERATOR);
    Frame frame = new Frame(ecef, new Transform(date, rotation), "other");
    Vector3D pEcef = new Vector3D(6378137 + 300e3, 0, 0);
    Vector3D pFrame = ecef.getTransformTo(frame, date).transformPosition(pEcef);
    PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
    OneAxisEllipsoid earth = new OneAxisEllipsoid(6378136.460, 1.0 / 298.257222101, ecef);
    SolarInputs97to05 in = SolarInputs97to05.getInstance();
    earth.setAngularThreshold(1e-10);
    DTM2000 atm = new DTM2000(in, sun, earth);
    // action
    final double actual = atm.getDensity(date, pFrame, frame);
    // verify
    Assert.assertEquals(atm.getDensity(date, pEcef, ecef), actual, 0.0);
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) SolarInputs97to05(org.orekit.SolarInputs97to05) Transform(org.orekit.frames.Transform) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 3 with SolarInputs97to05

use of org.orekit.SolarInputs97to05 in project Orekit by CS-SI.

the class DTM2000Test method testField.

@Test
public void testField() throws OrekitException {
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
    OneAxisEllipsoid earth = new OneAxisEllipsoid(6378136.460, 1.0 / 298.257222101, itrf);
    SolarInputs97to05 in = SolarInputs97to05.getInstance();
    earth.setAngularThreshold(1e-10);
    DTM2000 atm = new DTM2000(in, sun, earth);
    // Computation and results
    for (double alti = 400; alti < 1000; alti += 50) {
        for (double lon = 0; lon < 6; lon += 0.5) {
            for (double lat = -1.5; lat < 1.5; lat += 0.5) {
                for (double hl = 0; hl < 6; hl += 0.5) {
                    double rhoD = atm.getDensity(185, alti * 1000, lon, lat, hl, 50, 150, 0, 0);
                    Decimal64 rho64 = atm.getDensity(185, new Decimal64(alti * 1000), new Decimal64(lon), new Decimal64(lat), new Decimal64(hl), 50, 150, 0, 0);
                    Assert.assertEquals(rhoD, rho64.getReal(), rhoD * 1e-14);
                }
            }
        }
    }
}
Also used : Frame(org.orekit.frames.Frame) OneAxisEllipsoid(org.orekit.bodies.OneAxisEllipsoid) Decimal64(org.hipparchus.util.Decimal64) PVCoordinatesProvider(org.orekit.utils.PVCoordinatesProvider) SolarInputs97to05(org.orekit.SolarInputs97to05) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 SolarInputs97to05 (org.orekit.SolarInputs97to05)3 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)3 Frame (org.orekit.frames.Frame)3 PVCoordinatesProvider (org.orekit.utils.PVCoordinatesProvider)3 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)1 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)1 Decimal64 (org.hipparchus.util.Decimal64)1 Transform (org.orekit.frames.Transform)1 AbsoluteDate (org.orekit.time.AbsoluteDate)1