From d0086280d2f7332821986c5fae12c8ef634ac2ea Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Tue, 11 Mar 2014 17:42:31 +0100 Subject: [PATCH] Added configuration for sensor lines of sight. --- .../org/orekit/rugged/api/LineDatation.java | 36 ++++++ .../java/org/orekit/rugged/api/PixelLOS.java | 112 ++++++++++++++++++ .../java/org/orekit/rugged/api/Rugged.java | 7 ++ .../orekit/rugged/core/AbstractRugged.java | 54 ++++++++- 4 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 rugged-api/src/main/java/org/orekit/rugged/api/LineDatation.java create mode 100644 rugged-api/src/main/java/org/orekit/rugged/api/PixelLOS.java diff --git a/rugged-api/src/main/java/org/orekit/rugged/api/LineDatation.java b/rugged-api/src/main/java/org/orekit/rugged/api/LineDatation.java new file mode 100644 index 00000000..40e2fe6b --- /dev/null +++ b/rugged-api/src/main/java/org/orekit/rugged/api/LineDatation.java @@ -0,0 +1,36 @@ +/* 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; + +/** Interface representing line datation model. + * @author Luc Maisonobe + */ +public interface LineDatation { + + /** Get the date for a given line. + * @param param lineNumber line number + * @return date, as an offset in seconds from reference date + */ + double getDate(double lineNumber); + + /** Get the line for a given date. + * @param date, as an offset in seconds from reference date + * @return line number + */ + double getLine(double date); + +} diff --git a/rugged-api/src/main/java/org/orekit/rugged/api/PixelLOS.java b/rugged-api/src/main/java/org/orekit/rugged/api/PixelLOS.java new file mode 100644 index 00000000..9d638491 --- /dev/null +++ b/rugged-api/src/main/java/org/orekit/rugged/api/PixelLOS.java @@ -0,0 +1,112 @@ +/* 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; + +import java.io.Serializable; + +/** Container for pixels line of sight. + * <p> + * Instances of this class are guaranteed to be immutable. + * </p> + * @author Luc Maisonobe + */ +public class PixelLOS implements Serializable { + + /** Serializable UID. */ + private static final long serialVersionUID = 20140311L; + + /** Position along x axis(m). */ + private final double px; + + /** Position along y axis(m). */ + private final double py; + + /** Position along z axis(m). */ + private final double pz; + + /** Line of sight direction along x axis. */ + private final double dx; + + /** Line of sight direction along x axis. */ + private final double dy; + + /** Line of sight direction along x axis. */ + private final double dz; + + /** + * Build a new instance. + * + * @param px position along x axis (m) + * @param py position along y axis (m) + * @param pz position along z axis (m) + * @param dx line of sight direction along x axis + * @param dy line of sight direction along y axis + * @param dz line of sight direction along z axis + */ + public PixelLOS(final double px, double py, double pz, + final double dx, double dy, double dz) { + this.px = px; + this.py = py; + this.pz = pz; + this.dx = dx; + this.dy = dy; + this.dz = dz; + } + + /** Get the position along x axis. + * @return position along x axis + */ + public double getPx() { + return px; + } + + /** Get the position along y axis. + * @return position along y axis + */ + public double getPy() { + return py; + } + + /** Get the position along z axis. + * @return position along z axis + */ + public double getPz() { + return pz; + } + + /** Get the line of sight direction along x axis. + * @return line of sight direction along x axis + */ + public double getDx() { + return dx; + } + + /** Get the line of sight direction along y axis. + * @return line of sight direction along y axis + */ + public double getDy() { + return dy; + } + + /** Get the line of sight direction along z axis. + * @return line of sight direction along z axis + */ + public double getDz() { + return dz; + } + +} diff --git a/rugged-api/src/main/java/org/orekit/rugged/api/Rugged.java b/rugged-api/src/main/java/org/orekit/rugged/api/Rugged.java index de148bcf..fd4d55d7 100644 --- a/rugged-api/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/rugged-api/src/main/java/org/orekit/rugged/api/Rugged.java @@ -68,6 +68,13 @@ public interface Rugged { */ void setUpTilesManagement(TileUpdater updater, int maxCachedTiles); + /** Set up sensor model. + * @param sensorName name of the sensor. + * @param linesOfSigth lines of sight for each pixels + * @param datationModel model to use for dating sensor lines + */ + void setSensor(String sensorName, List<PixelLOS> linesOfSigth, LineDatation datationModel); + /** Direct localization of a sensor line. * @param sensorName name of the sensor * @param lineNumber number of the line to localize on ground diff --git a/rugged-core/src/main/java/org/orekit/rugged/core/AbstractRugged.java b/rugged-core/src/main/java/org/orekit/rugged/core/AbstractRugged.java index ba5485e3..a666b36f 100644 --- a/rugged-core/src/main/java/org/orekit/rugged/core/AbstractRugged.java +++ b/rugged-core/src/main/java/org/orekit/rugged/core/AbstractRugged.java @@ -39,6 +39,7 @@ import org.orekit.orbits.CartesianOrbit; import org.orekit.orbits.Orbit; import org.orekit.propagation.Propagator; import org.orekit.rugged.api.GroundPoint; +import org.orekit.rugged.api.LineDatation; import org.orekit.rugged.api.PixelLOS; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.api.RuggedException; @@ -79,12 +80,12 @@ public abstract class AbstractRugged implements Rugged { private AttitudeProvider aProvider; /** Sensors. */ - private final Map<String, List<Line>> sensors; + private final Map<String, Sensor> sensors; /** Simple constructor. */ protected AbstractRugged() { - sensors = new HashMap<String, List<Line>>(); + sensors = new HashMap<String, Sensor>(); } /** {@inheritDoc} */ @@ -141,7 +142,7 @@ public abstract class AbstractRugged implements Rugged { /** {@inheritDoc} */ @Override - public void setSensor(final String sensorName, final List<PixelLOS> linesOfSigth) { + public void setSensor(final String sensorName, final List<PixelLOS> linesOfSigth, final LineDatation datationModel) { final List<Line> los = new ArrayList<Line>(linesOfSigth.size()); for (final PixelLOS plos : linesOfSigth) { los.add(new Line(new Vector3D(plos.getPx(), @@ -152,7 +153,7 @@ public abstract class AbstractRugged implements Rugged { plos.getPz() + plos.getDz()), 1.0e-3)); } - sensors.put(sensorName, los); + sensors.put(sensorName, new Sensor(sensorName, los, datationModel)); } /** Select time scale Orekit data. @@ -334,4 +335,49 @@ public abstract class AbstractRugged implements Rugged { } } + /** Local container for sensor data. */ + private static class Sensor { + + /** Name of the sensor. */ + private String name; + + /** Pixels lines-of-sight. */ + private List<Line> los; + + /** Datation model. */ + private LineDatation datationModel; + + /** Simple constructor. + * @param name name of the sensor + * @param los pixels lines-of-sight + * @param datationModel datation model + */ + public Sensor(final String name, final List<Line> los, final LineDatation datationModel) { + this.name = name; + this.los = los; + this.datationModel = datationModel; + } + + /** Get the name of the sensor. + * @preturn name of the sensor + */ + public String getName() { + return name; + } + + /** Get the pixels lines-of-sight. + * @return pixels lines-of-sight + */ + public List<Line> getLos() { + return los; + } + + /** Get the datation model. + * @return datation model + */ + public LineDatation getDatationModel() { + return datationModel; + } + + } } -- GitLab