diff --git a/src/main/java/org/orekit/rugged/los/LOSBuilder.java b/src/main/java/org/orekit/rugged/los/LOSBuilder.java index db8f92af4039b5e806fe05f9df37351e1ae1307a..434e4820a83c3158838687165729db5e1cf46a35 100644 --- a/src/main/java/org/orekit/rugged/los/LOSBuilder.java +++ b/src/main/java/org/orekit/rugged/los/LOSBuilder.java @@ -19,6 +19,8 @@ package org.orekit.rugged.los; import java.util.ArrayList; import java.util.List; +import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; +import org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.orekit.time.AbsoluteDate; @@ -115,7 +117,7 @@ public class LOSBuilder { private static class FixedLOS implements TimeDependentLOS { /** Fixed direction for los. */ - private final Vector3D[] los; + private final Vector3D[] los; /** Simple constructor. * @param raw raw directions @@ -146,6 +148,15 @@ public class LOSBuilder { return los[index]; } + /** {@inheritDoc} */ + public FieldVector3D<DerivativeStructure> getLOS(final int index, final AbsoluteDate date, + final double[] parameters) { + // fixed LOS do not depend on any parameters + return new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters.length, 1, los[index].getX()), + new DerivativeStructure(parameters.length, 1, los[index].getY()), + new DerivativeStructure(parameters.length, 1, los[index].getZ())); + } + } /** Implement time-dependent LOS by applying all registered transforms at runtime. */ @@ -194,6 +205,16 @@ public class LOSBuilder { return los.normalize(); } + /** {@inheritDoc} */ + public FieldVector3D<DerivativeStructure> getLOS(final int index, final AbsoluteDate date, + final double[] parameters) { + // non-adjustable LOS do not depend on any parameters + final Vector3D los = getLOS(index, date); + return new FieldVector3D<DerivativeStructure>(new DerivativeStructure(parameters.length, 1, los.getX()), + new DerivativeStructure(parameters.length, 1, los.getY()), + new DerivativeStructure(parameters.length, 1, los.getZ())); + } + } } diff --git a/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java b/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java index 159c991b375c10b3171c189ca630c2d99cba518b..0479a9b1c05bc3e4a4e0144f9c2fe6ea8a3b7a09 100644 --- a/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java +++ b/src/main/java/org/orekit/rugged/los/TimeDependentLOS.java @@ -16,6 +16,8 @@ */ package org.orekit.rugged.los; +import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; +import org.apache.commons.math3.geometry.euclidean.threed.FieldVector3D; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.orekit.time.AbsoluteDate; @@ -37,4 +39,18 @@ public interface TimeDependentLOS { */ Vector3D getLOS(int index, AbsoluteDate date); + /** Get the line of sight and its partial derivatives for a given date. + * <p> + * This method is used for LOS calibration purposes. It allows to compute + * the Jacobian matrix of the LOS with respect to the parameters, which + * are typically polynomials coefficients representing rotation angles. + * These polynomials can be used for example to model thermo-elestic effects. + * </p> + * @param index los pixel index + * @param date date + * @param parameters current estimate of the adjusted parameters + * @return line of sight, and its first partial derivatives with respect to the parameters + */ + FieldVector3D<DerivativeStructure> getLOS(int index, AbsoluteDate date, double[] parameters); + }