Search in sources :

Example 6 with FieldTransform

use of org.orekit.frames.FieldTransform in project Orekit by CS-SI.

the class GroundStation method getOffsetToInertial.

/**
 * Get the transform between offset frame and inertial frame with derivatives.
 * <p>
 * As the East and North vector are not well defined at pole, the derivatives
 * of these two vectors diverge to infinity as we get closer to the pole.
 * So this method should not be used for stations less than 0.0001 degree from
 * either poles.
 * </p>
 * @param inertial inertial frame to transform to
 * @param date date of the transform
 * @param factory factory for the derivatives
 * @param indices indices of the estimated parameters in derivatives computations
 * @return offset frame defining vectors with derivatives
 * @exception OrekitException if some frame transforms cannot be computed
 * @since 9.0
 */
public FieldTransform<DerivativeStructure> getOffsetToInertial(final Frame inertial, final FieldAbsoluteDate<DerivativeStructure> date, final DSFactory factory, final Map<String, Integer> indices) throws OrekitException {
    final Field<DerivativeStructure> field = date.getField();
    final FieldVector3D<DerivativeStructure> zero = FieldVector3D.getZero(field);
    final FieldVector3D<DerivativeStructure> plusI = FieldVector3D.getPlusI(field);
    final FieldVector3D<DerivativeStructure> plusK = FieldVector3D.getPlusK(field);
    // take Earth offsets into account
    final FieldTransform<DerivativeStructure> intermediateToBody = estimatedEarthFrameProvider.getTransform(date, factory, indices).getInverse();
    // take station offset into account
    final DerivativeStructure x = parametricModel(factory, eastOffsetDriver, indices);
    final DerivativeStructure y = parametricModel(factory, northOffsetDriver, indices);
    final DerivativeStructure z = parametricModel(factory, zenithOffsetDriver, indices);
    final BodyShape baseShape = baseFrame.getParentShape();
    final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), (AbsoluteDate) null);
    FieldVector3D<DerivativeStructure> origin = baseToBody.transformPosition(new FieldVector3D<>(x, y, z));
    origin = origin.add(computeDisplacement(date.toAbsoluteDate(), origin.toVector3D()));
    final FieldGeodeticPoint<DerivativeStructure> originGP = baseShape.transform(origin, baseShape.getBodyFrame(), date);
    final FieldTransform<DerivativeStructure> offsetToIntermediate = new FieldTransform<>(date, new FieldTransform<>(date, new FieldRotation<>(plusI, plusK, originGP.getEast(), originGP.getZenith()), zero), new FieldTransform<>(date, origin));
    // combine all transforms together
    final FieldTransform<DerivativeStructure> bodyToInert = baseFrame.getParent().getTransformTo(inertial, date);
    return new FieldTransform<>(date, offsetToIntermediate, new FieldTransform<>(date, intermediateToBody, bodyToInert));
}
Also used : FieldTransform(org.orekit.frames.FieldTransform) DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) Transform(org.orekit.frames.Transform) FieldTransform(org.orekit.frames.FieldTransform) BodyShape(org.orekit.bodies.BodyShape) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation)

Aggregations

FieldTransform (org.orekit.frames.FieldTransform)6 Transform (org.orekit.frames.Transform)5 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)4 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)4 AbsoluteDate (org.orekit.time.AbsoluteDate)4 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)4 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)3 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)3 PVCoordinates (org.orekit.utils.PVCoordinates)3 TimeStampedFieldPVCoordinates (org.orekit.utils.TimeStampedFieldPVCoordinates)3 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)3 HashMap (java.util.HashMap)2 RealFieldElement (org.hipparchus.RealFieldElement)2 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)2 FieldRotation (org.hipparchus.geometry.euclidean.threed.FieldRotation)2 FieldGeodeticPoint (org.orekit.bodies.FieldGeodeticPoint)2 GeodeticPoint (org.orekit.bodies.GeodeticPoint)2 Frame (org.orekit.frames.Frame)2 ArrayList (java.util.ArrayList)1 Field (org.hipparchus.Field)1