Search in sources :

Example 31 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class AlignmentDetector method g.

/**
 * Compute the value of the switching function.
 * This function measures the difference between the alignment angle and the
 * angle between the satellite position and the body position projection in the
 * orbital plane.
 * @param s the current state information: date, kinematics, attitude
 * @return value of the switching function
 * @exception OrekitException if some specific error occurs
 */
public double g(final SpacecraftState s) throws OrekitException {
    final PVCoordinates pv = s.getPVCoordinates();
    final Vector3D a = pv.getPosition().normalize();
    final Vector3D b = Vector3D.crossProduct(pv.getMomentum(), a).normalize();
    final Vector3D x = new Vector3D(cosAlignAngle, a, sinAlignAngle, b);
    final Vector3D y = new Vector3D(sinAlignAngle, a, -cosAlignAngle, b);
    final Vector3D pb = body.getPVCoordinates(s.getDate(), s.getFrame()).getPosition();
    final double beta = FastMath.atan2(Vector3D.dotProduct(pb, y), Vector3D.dotProduct(pb, x));
    final double betm = -FastMath.PI - beta;
    final double betp = FastMath.PI - beta;
    if (beta < betm) {
        return betm;
    } else if (beta < betp) {
        return beta;
    } else {
        return betp;
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates)

Example 32 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class AngularSeparationDetector method g.

/**
 * Compute the value of the switching function.
 * <p>
 * This function measures the angular separation between beacon and spacecraft
 * as seen from the observer minus the proximity angle. It therefore triggers
 * decreasing events when the spacecraft enters the proximity zone and increasing
 * events when it leaves the proximity zone.
 * </p>
 * <p>
 * No shadowing effect is taken into account, so this method is computed and
 * may trigger events even when the spacecraft is below horizon for an observer
 * which is a ground station. If such effects must be taken into account the
 * detector must be associated with a {@link EventEnablingPredicateFilter predicate
 * filter} where the {@link EnablingPredicate predicate function} is based on elevation.
 * </p>
 * @param s the current state information: date, kinematics, attitude
 * @return value of the switching function
 * @exception OrekitException if some specific error occurs
 */
public double g(final SpacecraftState s) throws OrekitException {
    final PVCoordinates sPV = s.getPVCoordinates();
    final PVCoordinates bPV = beacon.getPVCoordinates(s.getDate(), s.getFrame());
    final PVCoordinates oPV = observer.getPVCoordinates(s.getDate(), s.getFrame());
    final double separation = Vector3D.angle(sPV.getPosition().subtract(oPV.getPosition()), bPV.getPosition().subtract(oPV.getPosition()));
    return separation - proximityAngle;
}
Also used : PVCoordinates(org.orekit.utils.PVCoordinates)

Example 33 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class FieldCartesianOrbit method toOrbit.

@Override
public CartesianOrbit toOrbit() {
    final PVCoordinates pv = getPVCoordinates().toPVCoordinates();
    final AbsoluteDate date = getPVCoordinates().getDate().toAbsoluteDate();
    if (hasDerivatives()) {
        // getPVCoordinates includes accelerations that will be interpreted as derivatives
        return new CartesianOrbit(pv, getFrame(), date, getMu());
    } else {
        // we have derivatives when in fact we don't have them
        return new CartesianOrbit(new PVCoordinates(pv.getPosition(), pv.getVelocity()), getFrame(), date, getMu());
    }
}
Also used : FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 34 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class TopocentricFrame method getRangeRate.

/**
 * Get the range rate of a point with regards to the topocentric frame center point.
 * @param extPV point/velocity for which range rate shall be computed
 * @param frame frame in which the point is defined
 * @param date computation date
 * @return range rate of the point (positive if point departs from frame)
 * @exception OrekitException if frames transformations cannot be computed
 */
public double getRangeRate(final PVCoordinates extPV, final Frame frame, final AbsoluteDate date) throws OrekitException {
    // Transform given point from given frame to topocentric frame
    final Transform t = frame.getTransformTo(this, date);
    final PVCoordinates extPVTopo = t.transformPVCoordinates(extPV);
    // Compute range rate (doppler) : relative rate along the line of sight
    return Vector3D.dotProduct(extPVTopo.getPosition(), extPVTopo.getVelocity()) / extPVTopo.getPosition().getNorm();
}
Also used : TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates)

Example 35 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class L1TransformProvider method getTransform.

/**
 * {@inheritDoc}
 */
@Override
public Transform getTransform(final AbsoluteDate date) throws OrekitException {
    final PVCoordinates pv21 = secondaryBody.getPVCoordinates(date, frame);
    final Vector3D translation = getL1(pv21.getPosition()).negate();
    final Rotation rotation = new Rotation(pv21.getPosition(), pv21.getVelocity(), Vector3D.PLUS_I, Vector3D.PLUS_J);
    return new Transform(date, new Transform(date, translation), new Transform(date, rotation));
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Aggregations

PVCoordinates (org.orekit.utils.PVCoordinates)341 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)271 Test (org.junit.Test)242 AbsoluteDate (org.orekit.time.AbsoluteDate)189 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)159 SpacecraftState (org.orekit.propagation.SpacecraftState)95 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)76 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)73 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)71 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)67 Orbit (org.orekit.orbits.Orbit)65 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)57 Frame (org.orekit.frames.Frame)53 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)44 CartesianOrbit (org.orekit.orbits.CartesianOrbit)43 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)42 DateComponents (org.orekit.time.DateComponents)40 CircularOrbit (org.orekit.orbits.CircularOrbit)37 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)30 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)30