use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class EstimatedEarthFrameProvider method getTransform.
/**
* {@inheritDoc}
*/
@Override
public Transform getTransform(final AbsoluteDate date) throws OrekitException {
// take parametric prime meridian shift into account
final double theta = linearModel(date, primeMeridianOffsetDriver, primeMeridianDriftDriver);
final double thetaDot = parametricModel(primeMeridianDriftDriver);
final Transform meridianShift = new Transform(date, new Rotation(Vector3D.PLUS_K, theta, RotationConvention.FRAME_TRANSFORM), new Vector3D(0, 0, thetaDot));
// take parametric pole shift into account
final double xpNeg = -linearModel(date, polarOffsetXDriver, polarDriftXDriver);
final double ypNeg = -linearModel(date, polarOffsetYDriver, polarDriftYDriver);
final double xpNegDot = -parametricModel(polarDriftXDriver);
final double ypNegDot = -parametricModel(polarDriftYDriver);
final Transform poleShift = new Transform(date, new Transform(date, new Rotation(Vector3D.PLUS_J, xpNeg, RotationConvention.FRAME_TRANSFORM), new Vector3D(0.0, xpNegDot, 0.0)), new Transform(date, new Rotation(Vector3D.PLUS_I, ypNeg, RotationConvention.FRAME_TRANSFORM), new Vector3D(ypNegDot, 0.0, 0.0)));
return new Transform(date, meridianShift, poleShift);
}
use of org.orekit.frames.Transform 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));
}
use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class OnBoardAntennaInterSatellitesRangeModifier method modifyOneWay.
/**
* Apply a modifier to an estimated measurement in the one-way case.
* @param estimated estimated measurement to modify
*/
private void modifyOneWay(final EstimatedMeasurement<InterSatellitesRange> estimated) {
// the participants are satellite 2 at emission, satellite 1 at reception
final TimeStampedPVCoordinates[] participants = estimated.getParticipants();
final AbsoluteDate emissionDate = participants[0].getDate();
final AbsoluteDate receptionDate = participants[1].getDate();
// transforms from spacecraft to inertial frame at emission/reception dates
final SpacecraftState refState1 = estimated.getStates()[0];
final SpacecraftState receptionState = refState1.shiftedBy(receptionDate.durationFrom(refState1.getDate()));
final Transform receptionSpacecraftToInert = receptionState.toTransform().getInverse();
final SpacecraftState refState2 = estimated.getStates()[1];
final SpacecraftState emissionState = refState2.shiftedBy(emissionDate.durationFrom(refState2.getDate()));
final Transform emissionSpacecraftToInert = emissionState.toTransform().getInverse();
// compute the geometrical value of the inter-satellites range directly from participants positions.
// Note that this may be different from the value returned by estimated.getEstimatedValue(),
// because other modifiers may already have been taken into account
final Vector3D pSpacecraftReception = receptionSpacecraftToInert.transformPosition(Vector3D.ZERO);
final Vector3D pSpacecraftEmission = emissionSpacecraftToInert.transformPosition(Vector3D.ZERO);
final double interSatellitesRangeUsingSpacecraftCenter = Vector3D.distance(pSpacecraftEmission, pSpacecraftReception);
// compute the geometrical value of the range replacing
// the spacecraft positions with antenna phase center positions
final Vector3D pAPCReception = receptionSpacecraftToInert.transformPosition(antennaPhaseCenter1);
final Vector3D pAPCEmission = emissionSpacecraftToInert.transformPosition(antennaPhaseCenter2);
final double interSatellitesRangeUsingAntennaPhaseCenter = Vector3D.distance(pAPCEmission, pAPCReception);
// get the estimated value before this modifier is applied
final double[] value = estimated.getEstimatedValue();
// modify the value
value[0] += interSatellitesRangeUsingAntennaPhaseCenter - interSatellitesRangeUsingSpacecraftCenter;
estimated.setEstimatedValue(value);
}
use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class OnBoardAntennaTurnAroundRangeModifier method modify.
/**
* {@inheritDoc}
*/
@Override
public void modify(final EstimatedMeasurement<TurnAroundRange> estimated) {
// the participants are master station at emission, spacecraft during leg 1,
// slave station at rebound, spacecraft during leg 2, master station at reception
final TimeStampedPVCoordinates[] participants = estimated.getParticipants();
final Vector3D pMasterEmission = participants[0].getPosition();
final AbsoluteDate transitDateLeg1 = participants[1].getDate();
final Vector3D pSlaveRebound = participants[2].getPosition();
final AbsoluteDate transitDateLeg2 = participants[3].getDate();
final Vector3D pMasterReception = participants[4].getPosition();
// transforms from spacecraft to inertial frame at transit dates
final SpacecraftState refState = estimated.getStates()[0];
final SpacecraftState transitStateLeg1 = refState.shiftedBy(transitDateLeg1.durationFrom(refState.getDate()));
final Transform spacecraftToInertLeg1 = transitStateLeg1.toTransform().getInverse();
final SpacecraftState transitStateLeg2 = refState.shiftedBy(transitDateLeg2.durationFrom(refState.getDate()));
final Transform spacecraftToInertLeg2 = transitStateLeg2.toTransform().getInverse();
// compute the geometrical value of the turn-around range directly from participants positions.
// Note that this may be different from the value returned by estimated.getEstimatedValue(),
// because other modifiers may already have been taken into account
final Vector3D pSpacecraftLeg1 = spacecraftToInertLeg1.transformPosition(Vector3D.ZERO);
final Vector3D pSpacecraftLeg2 = spacecraftToInertLeg2.transformPosition(Vector3D.ZERO);
final double turnAroundRangeUsingSpacecraftCenter = 0.5 * (Vector3D.distance(pMasterEmission, pSpacecraftLeg1) + Vector3D.distance(pSpacecraftLeg1, pSlaveRebound) + Vector3D.distance(pSlaveRebound, pSpacecraftLeg2) + Vector3D.distance(pSpacecraftLeg2, pMasterReception));
// compute the geometrical value of the range replacing
// the spacecraft positions with antenna phase center positions
final Vector3D pAPCLeg1 = spacecraftToInertLeg1.transformPosition(antennaPhaseCenter);
final Vector3D pAPCLeg2 = spacecraftToInertLeg2.transformPosition(antennaPhaseCenter);
final double turnAroundRangeUsingAntennaPhaseCenter = 0.5 * (Vector3D.distance(pMasterEmission, pAPCLeg1) + Vector3D.distance(pAPCLeg1, pSlaveRebound) + Vector3D.distance(pSlaveRebound, pAPCLeg2) + Vector3D.distance(pAPCLeg2, pMasterReception));
// get the estimated value before this modifier is applied
final double[] value = estimated.getEstimatedValue();
// modify the value
value[0] += turnAroundRangeUsingAntennaPhaseCenter - turnAroundRangeUsingSpacecraftCenter;
estimated.setEstimatedValue(value);
}
use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class FieldElevationDetector method g.
/**
* Compute the value of the switching function.
* This function measures the difference between the current elevation
* (and azimuth if necessary) and the reference mask or minimum value.
* @param s the current state information: date, kinematics, attitude
* @return value of the switching function
* @exception OrekitException if some specific error occurs
*/
@Override
public T g(final FieldSpacecraftState<T> s) throws OrekitException {
final Transform t = s.getFrame().getTransformTo(topo, s.getDate().toAbsoluteDate());
final FieldVector3D<T> extPointTopo = t.transformPosition(s.getPVCoordinates().getPosition());
final T trueElevation = extPointTopo.getDelta();
final T calculatedElevation;
if (refractionModel != null) {
calculatedElevation = trueElevation.add(refractionModel.getRefraction(trueElevation.getReal()));
} else {
calculatedElevation = trueElevation;
}
if (elevationMask != null) {
final double azimuth = FastMath.atan2(extPointTopo.getY().getReal(), extPointTopo.getX().getReal());
return calculatedElevation.subtract(elevationMask.getElevation(azimuth));
} else {
return calculatedElevation.subtract(minElevation);
}
}
Aggregations