From 1e348e491b711f6cde6faf261e1e4e43edbe60a5 Mon Sep 17 00:00:00 2001
From: sesteves <sroesteves@gmail.com>
Date: Fri, 1 Jul 2016 01:24:06 +0100
Subject: [PATCH] added skeleton for atmospheric refraction

---
 .../java/org/orekit/rugged/api/Rugged.java    |  7 +++++
 .../AtmosphericRefraction.java                | 30 +++++++++++++++++++
 .../MultiLayerModel.java                      | 18 +++++++++++
 .../duvenhage/DuvenhageAlgorithm.java         |  2 ++
 4 files changed, 57 insertions(+)
 create mode 100644 src/main/java/org/orekit/rugged/atmosphericrefraction/AtmosphericRefraction.java
 create mode 100644 src/main/java/org/orekit/rugged/atmosphericrefraction/MultiLayerModel.java

diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java
index ee141033..afce96aa 100644
--- a/src/main/java/org/orekit/rugged/api/Rugged.java
+++ b/src/main/java/org/orekit/rugged/api/Rugged.java
@@ -26,6 +26,8 @@ import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
 import org.apache.commons.math3.util.FastMath;
 import org.orekit.bodies.GeodeticPoint;
 import org.orekit.frames.Transform;
+import org.orekit.rugged.atmosphericrefraction.AtmosphericRefraction;
+import org.orekit.rugged.atmosphericrefraction.MultiLayerModel;
 import org.orekit.rugged.errors.DumpManager;
 import org.orekit.rugged.errors.RuggedException;
 import org.orekit.rugged.errors.RuggedMessages;
@@ -339,6 +341,11 @@ public class Rugged {
             final Vector3D lBody = inertToBody.transformVector(lInert);
             result = algorithm.refineIntersection(ellipsoid, pBody, lBody,
                                                   algorithm.intersection(ellipsoid, pBody, lBody));
+
+            // compute atmosphere deviation.
+            AtmosphericRefraction atmosphericRefraction = new MultiLayerModel();
+            long deviation = atmosphericRefraction.getDeviation(pBody, lBody, result.getAltitude());
+
         }
 
         DumpManager.dumpDirectLocationResult(result);
diff --git a/src/main/java/org/orekit/rugged/atmosphericrefraction/AtmosphericRefraction.java b/src/main/java/org/orekit/rugged/atmosphericrefraction/AtmosphericRefraction.java
new file mode 100644
index 00000000..d17b112e
--- /dev/null
+++ b/src/main/java/org/orekit/rugged/atmosphericrefraction/AtmosphericRefraction.java
@@ -0,0 +1,30 @@
+/* Copyright 2013-2016 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.rugged.atmosphericrefraction;
+
+
+import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
+
+/**
+ * Interface for atmospheric refraction.
+ * @author Sergio Esteves
+ */
+public interface AtmosphericRefraction {
+
+    long getDeviation(Vector3D pos, Vector3D los, double altitude);
+
+}
diff --git a/src/main/java/org/orekit/rugged/atmosphericrefraction/MultiLayerModel.java b/src/main/java/org/orekit/rugged/atmosphericrefraction/MultiLayerModel.java
new file mode 100644
index 00000000..ab5ad84e
--- /dev/null
+++ b/src/main/java/org/orekit/rugged/atmosphericrefraction/MultiLayerModel.java
@@ -0,0 +1,18 @@
+package org.orekit.rugged.atmosphericrefraction;
+
+import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
+
+/**
+ * Multi layer model for atmospheric refraction.
+ * @author Sergio Esteves
+ */
+public class MultiLayerModel implements AtmosphericRefraction {
+
+    @Override
+    public long getDeviation(Vector3D pos, Vector3D los, double altitude) {
+
+
+
+        return 0;
+    }
+}
diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java
index 207d4603..5b4e4ff2 100644
--- a/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java
+++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java
@@ -78,6 +78,8 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm {
             // compute intersection with ellipsoid
             final NormalizedGeodeticPoint gp0 = ellipsoid.pointOnGround(position, los, 0.0);
 
+            // compute atmosphere deviation
+
             // locate the entry tile along the line-of-sight
             MinMaxTreeTile tile = cache.getTile(gp0.getLatitude(), gp0.getLongitude());
 
-- 
GitLab