1   /* Copyright 2002-2022 CS GROUP
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.models.earth.atmosphere;
18  
19  
20  import org.hipparchus.geometry.euclidean.threed.Vector3D;
21  import org.junit.Assert;
22  import org.junit.Before;
23  import org.junit.Test;
24  import org.orekit.Utils;
25  import org.orekit.bodies.OneAxisEllipsoid;
26  import org.orekit.frames.Frame;
27  import org.orekit.frames.FramesFactory;
28  import org.orekit.frames.Transform;
29  import org.orekit.time.AbsoluteDate;
30  import org.orekit.utils.IERSConventions;
31  
32  
33  public class SimpleExponentialAtmosphereTest {
34  
35      @Test
36      public void testExpAtmosphere() {
37          Vector3D posInEME2000 = new Vector3D(10000, Vector3D.PLUS_I);
38          AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
39          Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
40          SimpleExponentialAtmosphere atm =
41              new SimpleExponentialAtmosphere(new OneAxisEllipsoid(Utils.ae, 1.0 / 298.257222101, itrf),
42                                              0.0004, 42000.0, 7500.0);
43          Vector3D vel = atm.getVelocity(date, posInEME2000, FramesFactory.getEME2000());
44  
45          Transform toBody = FramesFactory.getEME2000().getTransformTo(itrf, date);
46          Vector3D test = Vector3D.crossProduct(toBody.getRotationRate(), posInEME2000);
47          test = test.subtract(vel);
48          Assert.assertEquals(0, test.getNorm(), 2.9e-5);
49  
50      }
51  
52      @Before
53      public void setUp() {
54          Utils.setDataRoot("regular-data");
55      }
56  
57  }