Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • orekit/rugged
  • sdinot/rugged
  • yzokras/rugged
  • youngcle/rugged-mod
4 results
Show changes
/* Copyright 2013-2016 CS Systèmes d'Information
* Licensed to CS Systèmes d'Information (CS) under one or more
/* Copyright 2013-2022 CS GROUP
* Licensed to CS GROUP (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
......@@ -14,19 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package AffinagePleiades;
package fr.cs.examples.refiningPleiades.models;
import java.util.ArrayList;
import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.RotationConvention;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import java.util.ArrayList;
import java.util.List;
import org.orekit.rugged.linesensor.LineDatation;
import org.orekit.rugged.linesensor.LineSensor;
import org.orekit.rugged.linesensor.LinearLineDatation;
import org.orekit.rugged.los.FixedRotation;
import org.orekit.rugged.los.FixedZHomothety;
import org.orekit.rugged.los.LOSBuilder;
......@@ -34,134 +33,146 @@ import org.orekit.rugged.los.TimeDependentLOS;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScale;
import org.orekit.time.TimeScalesFactory;
import org.orekit.rugged.linesensor.LinearLineDatation;
import org.orekit.rugged.linesensor.LineDatation;
import org.orekit.rugged.linesensor.LineSensor;
import org.orekit.rugged.errors.RuggedException;
import org.orekit.errors.OrekitException;
import fr.cs.examples.refiningPleiades.Refining;
/**
* Pleiades viewing model class definition.
* The aim of this class is to simulate PHR sensor.
* @author Jonathan Guinet
* @author Lucie Labat-Allee
* @author Guylaine Prat
* @since 2.0
*/
public class PleiadesViewingModel {
public double fov = 1.6; // 20km - alt 694km
public double angle = 0.0;
public double incidence = 15.0;
public LineSensor lineSensor;
public int dimension = 40000;
public String date = "2016-01-01T12:00:00.0";
private String sensorName;
/** Pleiades parameters. */
private static final double FOV = 1.65; // 20km - alt 694km
private static final int DIMENSION = 40000;
private static final double LINE_PERIOD = 1.e-4;
private double angle;
private LineSensor lineSensor;
private String date;
private String sensorName;
/** Simple constructor.
* <p>
*
* initialize PleiadesViewingModel with
* sensorName="line", incidenceAngle = 0.0, date = "2016-01-01T12:00:00.0"
* </p>
*/
public PleiadesViewingModel() throws RuggedException, OrekitException {
sensorName = "line";
this.createLineSensor();
public PleiadesViewingModel(final String sensorName) {
this(sensorName, 0.0, "2016-01-01T12:00:00.0");
}
/** PleiadesViewingModel constructor.
* @param sensorName sensor name
* @param incidenceAngle incidence angle
* @param referenceDate reference date
*/
public PleiadesViewingModel(final String sensorName, final double incidenceAngle, final String referenceDate) {
this.sensorName = sensorName;
this.date = referenceDate;
this.angle = incidenceAngle;
this.createLineSensor();
}
public LOSBuilder rawLOS(Vector3D center, Vector3D normal, double halfAperture, int n)
{
List<Vector3D> list = new ArrayList<Vector3D>(n);
/** Create raw fixed Line Of sight
*/
public LOSBuilder rawLOS(final Vector3D center, final Vector3D normal, final double halfAperture, final int n) {
final List<Vector3D> list = new ArrayList<Vector3D>(n);
for (int i = 0; i < n; ++i) {
double alpha = (halfAperture * (2 * i + 1 - n)) / (n - 1);
final double alpha = (halfAperture * (2 * i + 1 - n)) / (n - 1);
list.add(new Rotation(normal, alpha, RotationConvention.VECTOR_OPERATOR).applyTo(center));
}
return new LOSBuilder(list);
}
public TimeDependentLOS buildLOS()
{
// one line sensor
// position: 1.5m in front (+X) and 20 cm above (-Z) of the S/C center of mass
// los: swath in the (YZ) plane, looking at 50° roll, 2.6" per pixel
LOSBuilder losBuilder = rawLOS(new Rotation(Vector3D.PLUS_I,
FastMath.toRadians(angle),
RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K), Vector3D.PLUS_I, FastMath.toRadians(fov/2), dimension);
losBuilder.addTransform(new FixedRotation("roll", Vector3D.MINUS_I, 0.0));
losBuilder.addTransform(new FixedRotation("pitch", Vector3D.MINUS_J, 0.0));
losBuilder.addTransform(new FixedZHomothety("factor", 1.0));
return losBuilder.build();
}
public AbsoluteDate getDatationReference() throws OrekitException
{
// We use Orekit for handling time and dates, and Rugged for defining the datation model:
TimeScale utc = TimeScalesFactory.getUTC();
return new AbsoluteDate(date, utc);
}
public AbsoluteDate getMinDate() throws RuggedException
{
return lineSensor.getDate(0);
}
public AbsoluteDate getMaxDate() throws RuggedException
{
return lineSensor.getDate(dimension);
}
public LineSensor getLineSensor() {
return lineSensor;
}
public String getSensorName() {
return sensorName;
}
private void createLineSensor()
throws RuggedException, OrekitException {
//System.out.println("add line sensor");
// TBN: refining data are read only for level L1B or L1C
//System.out.println("refining info");
}
/** Build a LOS provider
*/
public TimeDependentLOS buildLOS() {
final LOSBuilder losBuilder = rawLOS(new Rotation(Vector3D.PLUS_I,
FastMath.toRadians(this.angle),
RotationConvention.VECTOR_OPERATOR).applyTo(Vector3D.PLUS_K),
Vector3D.PLUS_I, FastMath.toRadians(FOV / 2), DIMENSION);
losBuilder.addTransform(new FixedRotation(sensorName + Refining.getRollsuffix(), Vector3D.MINUS_I, 0.00));
losBuilder.addTransform(new FixedRotation(sensorName + Refining.getPitchsuffix(), Vector3D.MINUS_J, 0.00));
// factor is a common parameters shared between all Pleiades models
losBuilder.addTransform(new FixedZHomothety(Refining.getFactorname(), 1.0));
return losBuilder.build();
}
/** Get the reference date.
*/
public AbsoluteDate getDatationReference() {
// We use Orekit for handling time and dates, and Rugged for defining the datation model:
final TimeScale utc = TimeScalesFactory.getUTC();
return new AbsoluteDate(date, utc);
}
/** Get the min date.
*/
public AbsoluteDate getMinDate() {
return lineSensor.getDate(0);
}
/** Get the max date.
*/
public AbsoluteDate getMaxDate() {
return lineSensor.getDate(DIMENSION);
}
/** Get the line sensor.
*/
public LineSensor getLineSensor() {
return lineSensor;
}
/** Get the sensor name.
*/
public String getSensorName() {
return sensorName;
}
/** Get the number of lines of the sensor
* @return the number of lines of the sensor
*/
public int getDimension() {
return DIMENSION;
}
/** Create the line sensor
*/
private void createLineSensor() {
// Offset of the MSI from center of mass of satellite
//System.out.println("MSI offset from center of mass of satellite");
// one line sensor
// position: 1.5m in front (+X) and 20 cm above (-Z) of the S/C center of mass
// los: swath in the (YZ) plane, looking at 50° roll, 2.6" per pixel
//Vector3D msiOffset = new Vector3D(1.5, 0, -0.2);
Vector3D msiOffset = new Vector3D(0, 0, 0);
// to do build complex los
TimeDependentLOS lineOfSight = buildLOS();
double linePeriod = 1.0 / 1.5e-3;
// linear datation model: at reference time we get the middle line, and the rate is one line every 1.5ms
final Vector3D msiOffset = new Vector3D(0, 0, 0);
LineDatation lineDatation = new LinearLineDatation(getDatationReference(), dimension / 2, linePeriod);
//LineDatation lineDatation = new LinearLineDatation(absDate, 1d, 20);
lineSensor = new LineSensor(sensorName, lineDatation, msiOffset, lineOfSight);
final TimeDependentLOS lineOfSight = buildLOS();
}
final double rate = 1. / LINE_PERIOD;
// linear datation model: at reference time we get the middle line, and the rate is one line every 1.5ms
final LineDatation lineDatation = new LinearLineDatation(getDatationReference(), DIMENSION / 2, rate);
lineSensor = new LineSensor(sensorName, lineDatation, msiOffset, lineOfSight);
}
}