use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class LofOffsetPointing method getTargetPV.
/**
* {@inheritDoc}
*/
public TimeStampedPVCoordinates getTargetPV(final PVCoordinatesProvider pvProv, final AbsoluteDate date, final Frame frame) throws OrekitException {
// sample intersection points in current date neighborhood
final double h = 0.1;
final List<TimeStampedPVCoordinates> sample = new ArrayList<>();
Transform centralRefToBody = null;
for (int i = -1; i < 2; ++i) {
final AbsoluteDate shifted = date.shiftedBy(i * h);
// transform from specified reference frame to spacecraft frame
final Transform refToSc = new Transform(shifted, new Transform(shifted, pvProv.getPVCoordinates(shifted, frame).negate()), new Transform(shifted, attitudeLaw.getAttitude(pvProv, shifted, frame).getOrientation()));
// transform from specified reference frame to body frame
final Transform refToBody = frame.getTransformTo(shape.getBodyFrame(), shifted);
if (i == 0) {
centralRefToBody = refToBody;
}
sample.add(losIntersectionWithBody(new Transform(shifted, refToSc.getInverse(), refToBody)));
}
// use interpolation to compute properly the time-derivatives
final TimeStampedPVCoordinates targetBody = TimeStampedPVCoordinates.interpolate(date, CartesianDerivativesFilter.USE_P, sample);
// convert back to caller specified frame
return centralRefToBody.getInverse().transformPVCoordinates(targetBody);
}
use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class NadirPointing method getTargetPV.
/**
* {@inheritDoc}
*/
public TimeStampedPVCoordinates getTargetPV(final PVCoordinatesProvider pvProv, final AbsoluteDate date, final Frame frame) throws OrekitException {
// transform from specified reference frame to body frame
final Transform refToBody = frame.getTransformTo(shape.getBodyFrame(), date);
// sample intersection points in current date neighborhood
final double h = 0.01;
final List<TimeStampedPVCoordinates> sample = new ArrayList<>();
sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(-2 * h), frame), refToBody.shiftedBy(-2 * h)));
sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(-h), frame), refToBody.shiftedBy(-h)));
sample.add(nadirRef(pvProv.getPVCoordinates(date, frame), refToBody));
sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(+h), frame), refToBody.shiftedBy(+h)));
sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(+2 * h), frame), refToBody.shiftedBy(+2 * h)));
// use interpolation to compute properly the time-derivatives
return TimeStampedPVCoordinates.interpolate(date, CartesianDerivativesFilter.USE_P, sample);
}
use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class TabulatedLofOffset method getAttitude.
/**
* {@inheritDoc}
*/
public Attitude getAttitude(final PVCoordinatesProvider pvProv, final AbsoluteDate date, final Frame frame) throws OrekitException {
// get attitudes sample on which interpolation will be performed
final List<TimeStampedAngularCoordinates> sample = table.getNeighbors(date).collect(Collectors.toList());
// interpolate
final TimeStampedAngularCoordinates interpolated = TimeStampedAngularCoordinates.interpolate(date, filter, sample);
// construction of the local orbital frame, using PV from inertial frame
final PVCoordinates pv = pvProv.getPVCoordinates(date, inertialFrame);
final Transform inertialToLof = type.transformFromInertial(date, pv);
// take into account the specified start frame (which may not be an inertial one)
final Transform frameToInertial = frame.getTransformTo(inertialFrame, date);
final Transform frameToLof = new Transform(date, frameToInertial, inertialToLof);
// compose with interpolated rotation
return new Attitude(date, frame, interpolated.addOffset(frameToLof.getAngular()));
}
use of org.orekit.frames.Transform in project Orekit by CS-SI.
the class GroundStation method getOffsetGeodeticPoint.
/**
* Get the geodetic point at the center of the offset frame.
* @param date current date (may be null if displacements are ignored)
* @return geodetic point at the center of the offset frame
* @exception OrekitException if frames transforms cannot be computed
* @since 9.1
*/
public GeodeticPoint getOffsetGeodeticPoint(final AbsoluteDate date) throws OrekitException {
// take station offset into account
final double x = parametricModel(eastOffsetDriver);
final double y = parametricModel(northOffsetDriver);
final double z = parametricModel(zenithOffsetDriver);
final BodyShape baseShape = baseFrame.getParentShape();
final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), date);
Vector3D origin = baseToBody.transformPosition(new Vector3D(x, y, z));
if (date != null) {
origin = origin.add(computeDisplacement(date, origin));
}
return baseShape.transform(origin, baseShape.getBodyFrame(), null);
}
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.
* <p>
* The offset frame takes the <em>current</em> position offset,
* polar motion and the meridian shift into account. The frame
* returned is disconnected from later changes in the parameters.
* When the {@link ParameterDriver parameters} managing these
* offsets are changed, the method must be called again to retrieve
* a new offset frame.
* </p>
* @param inertial inertial frame to transform to
* @param date date of the transform
* @return offset frame defining vectors
* @exception OrekitException if offset frame cannot be computed for current offset values
*/
public Transform getOffsetToInertial(final Frame inertial, final AbsoluteDate date) throws OrekitException {
// take Earth offsets into account
final Transform intermediateToBody = estimatedEarthFrameProvider.getTransform(date).getInverse();
// take station offset into account
final double x = parametricModel(eastOffsetDriver);
final double y = parametricModel(northOffsetDriver);
final double z = parametricModel(zenithOffsetDriver);
final BodyShape baseShape = baseFrame.getParentShape();
final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), date);
Vector3D origin = baseToBody.transformPosition(new Vector3D(x, y, z));
origin = origin.add(computeDisplacement(date, origin));
final GeodeticPoint originGP = baseShape.transform(origin, baseShape.getBodyFrame(), date);
final Transform offsetToIntermediate = new Transform(date, new Transform(date, new Rotation(Vector3D.PLUS_I, Vector3D.PLUS_K, originGP.getEast(), originGP.getZenith()), Vector3D.ZERO), new Transform(date, origin));
// combine all transforms together
final Transform bodyToInert = baseFrame.getParent().getTransformTo(inertial, date);
return new Transform(date, offsetToIntermediate, new Transform(date, intermediateToBody, bodyToInert));
}
Aggregations