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));
}
Aggregations