Skip to content
Snippets Groups Projects
Commit 2f96d893 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Added API for global context initialization.

parent 29c2e438
No related branches found
No related tags found
No related merge requests found
/* Copyright 2013-2014 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.api;
/** Enumerate for line-of-sight intersection algorithm.
* @author Luc Maisonobe
*/
public enum LineOfSightAlgorithm {
/** Bernardt Duvenhage's algorithm.
* <p>
* The algorithm is described in the 2009 paper:
* <a href="http://researchspace.csir.co.za/dspace/bitstream/10204/3041/1/Duvenhage_2009.pdf">Using
* An Implicit Min/Max KD-Tree for Doing Efficient Terrain Line of Sight Calculations</a>.
* </p>
*/
DUVENHAGE;
}
......@@ -16,11 +16,50 @@
*/
package org.orekit.rugged.api;
import java.io.File;
import java.util.List;
/** Main interface to Rugged library.
* @author Luc Maisonobe
*/
public interface Rugged {
/** Enumerate for ellipsoid. */
enum Ellipsoid {
GRS80, WGS84, IERS96, IERS2003
}
/** Enumerate for inertial frames. */
enum InertialFrame {
GCRF, EME2000, MOD, TOD, VEIS1950
}
/** Enumerate for body rotating frames. */
enum BodyRotatingFrame {
ITRF, GTOD
}
/** Set up general context.
* <p>
* This method is the first one that must be called, otherwise the
* other methods will fail due to uninitialized context.
* </p>
* @param orekitDataDir top directory for Orekit data
* @param ellipsoid reference ellipsoid
* @param inertialFrameName inertial frame
* @param bodyRotatingFrame body rotating frame
* @param positionsVelocities satellite position and velocity
* @param pvInterpolationOrder order to use for position/velocity interpolation
* @param quaternions satellite quaternions
* @param aInterpolationOrder order to use for attitude interpolation
* @exception RuggedException if data needed for some frame cannot be loaded
*/
void setGeneralContext(File orekitDataDir, Ellipsoid ellipsoid,
InertialFrame inertialFrame, BodyRotatingFrame bodyRotatingFrame,
List<SatellitePV> positionsVelocities, int pvInterpolationOrder,
List<SatelliteQ> quaternions, int aInterpolationOrder)
throws RuggedException;
/** Set up the tiles management.
* @param updater updater used to load Digital Elevation Model tiles
* @param maxCachedTiles maximum number of tiles stored in the cache
......@@ -30,23 +69,25 @@ public interface Rugged {
/** Direct localization of a sensor line.
* @param sensorName name of the sensor
* @param lineNumber number of the line to localize on ground
* @param algorithm algorithm to use for line-of-sight/DEM intersection computation
* @return ground position of all pixels of the specified sensor line
* @exception RuggedException if line cannot be localized
* @exception RuggedException if line cannot be localized,
* if {@link #setGeneralContext(File, InertialFrame, BodyRotatingFrame, Ellipsoid)} has
* not been called beforehand, or if {@link #setOrbitAndAttitude(List, List)} has not
* been called beforehand
*/
GroundPoint[] directLocalization(String sensorName, int lineNumber,
LineOfSightAlgorithm algorithm)
GroundPoint[] directLocalization(String sensorName, int lineNumber)
throws RuggedException;
/** Inverse localization of a ground point.
* @param sensorName name of the sensor
* @param ground point to localize
* @param algorithm algorithm to use for line-of-sight/DEM intersection computation
* @return sensor pixel seeing ground point
* @exception RuggedException if line cannot be localized
* @exception RuggedException if line cannot be localized,
* if {@link #setGeneralContext(File, InertialFrame, BodyRotatingFrame, Ellipsoid)} has
* not been called beforehand, or if {@link #setOrbitAndAttitude(List, List)} has not
* been called beforehand
*/
SensorPixel inverseLocalization(String sensorName, GroundPoint groundPoint,
LineOfSightAlgorithm algorithm)
SensorPixel inverseLocalization(String sensorName, GroundPoint groundPoint)
throws RuggedException;
}
......@@ -62,7 +62,6 @@ public class RuggedException extends Exception {
/** Copy constructor.
* @param exception exception to copy from
* @since 5.1
*/
public RuggedException(final RuggedException exception) {
super(exception);
......
......@@ -51,7 +51,8 @@ public enum RuggedMessages implements Localizable {
// CHECKSTYLE: stop JavadocVariable check
INTERNAL_ERROR("internal error, contact maintenance at {0}"),
OUT_OF_TILE_INDICES("no data at indices [{0}, {1}], tile only covers from [0, 0] to [{2}, {3}] (inclusive)");
OUT_OF_TILE_INDICES("no data at indices [{0}, {1}], tile only covers from [0, 0] to [{2}, {3}] (inclusive)"),
UNINITIALIZED_CONTEXT("general context has not been initialized");
// CHECKSTYLE: resume JavadocVariable check
......
......@@ -3,3 +3,6 @@ INTERNAL_ERROR = internal error, contact maintenance at {0}
# no data at indices [{0}, {1}], tile only covers from [0, 0] to [{2}, {3}] (inclusive)
OUT_OF_TILE_INDICES = no data at indices [{0}, {1}], tile only covers from [0, 0] to [{2}, {3}] (inclusive)
# general context has not been initialized
UNINITIALIZED_CONTEXT = general context has not been initialized
......@@ -2,4 +2,7 @@
INTERNAL_ERROR = erreur interne, contactez la maintenance à {0}
# no data at indices [{0}, {1}], tile only covers from [0, 0] to [{2}, {3}] (inclusive)
OUT_OF_TILE_INDICES = aucune donnée aux indices {0}, {1}], la tuile ne couvre que de [0, 0] à [{2}, {3}] inclus
OUT_OF_TILE_INDICES = aucune donnée aux indices [{0}, {1}], la tuile ne couvre que de [0, 0] à [{2}, {3}] inclus
# general context has not been initialized
UNINITIALIZED_CONTEXT = le contexte général n''a pas été initialisé
......@@ -29,7 +29,7 @@ public class RuggedMessagesTest {
@Test
public void testMessageNumber() {
Assert.assertEquals(2, RuggedMessages.values().length);
Assert.assertEquals(3, RuggedMessages.values().length);
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment