Class LongitudeCrossingDetector

  • All Implemented Interfaces:
    EventDetector

    public class LongitudeCrossingDetector
    extends AbstractDetector<LongitudeCrossingDetector>
    Detector for geographic longitude crossing.

    This detector identifies when a spacecraft crosses a fixed longitude with respect to a central body.

    Since:
    7.1
    Author:
    Luc Maisonobe
    • Constructor Detail

      • LongitudeCrossingDetector

        public LongitudeCrossingDetector​(double maxCheck,
                                         double threshold,
                                         OneAxisEllipsoid body,
                                         double longitude)
        Build a detector.
        Parameters:
        maxCheck - maximal checking interval (s)
        threshold - convergence threshold (s)
        body - body on which the longitude is defined
        longitude - longitude to be crossed
      • LongitudeCrossingDetector

        protected LongitudeCrossingDetector​(AdaptableInterval maxCheck,
                                            double threshold,
                                            int maxIter,
                                            EventHandler handler,
                                            OneAxisEllipsoid body,
                                            double longitude)
        Protected constructor with full parameters.

        This constructor is not public as users are expected to use the builder API with the various withXxx() methods to set up the instance in a readable manner without using a huge amount of parameters.

        Parameters:
        maxCheck - maximum checking interval
        threshold - convergence threshold (s)
        maxIter - maximum number of iterations in the event time search
        handler - event handler to call at event occurrences
        body - body on which the longitude is defined
        longitude - longitude to be crossed
    • Method Detail

      • create

        protected LongitudeCrossingDetector create​(AdaptableInterval newMaxCheck,
                                                   double newThreshold,
                                                   int newMaxIter,
                                                   EventHandler newHandler)
        Build a new instance.
        Specified by:
        create in class AbstractDetector<LongitudeCrossingDetector>
        Parameters:
        newMaxCheck - maximum checking interval (s)
        newThreshold - convergence threshold (s)
        newMaxIter - maximum number of iterations in the event time search
        newHandler - event handler to call at event occurrences
        Returns:
        a new instance of the appropriate sub-type WARNING: this method will be removed in 13.0. It doesn't have the deprecated annotation because the method is abstract and shall be implemented
      • getBody

        public OneAxisEllipsoid getBody()
        Get the body on which the geographic zone is defined.
        Returns:
        body on which the geographic zone is defined
      • getLongitude

        public double getLongitude()
        Get the fixed longitude to be crossed (radians).
        Returns:
        fixed longitude to be crossed (radians)
      • init

        public void init​(SpacecraftState s0,
                         AbsoluteDate t)
        Initialize event handler at the start of a propagation.

        This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.

        The default implementation does nothing

        This implementation sets the direction of propagation and initializes the event handler. If a subclass overrides this method it should call super.init(s0, t).

        Specified by:
        init in interface EventDetector
        Overrides:
        init in class AbstractDetector<LongitudeCrossingDetector>
        Parameters:
        s0 - initial state
        t - target time for the integration
      • g

        public double g​(SpacecraftState s)
        Compute the value of the detection function.

        The value is the longitude difference between the spacecraft and the fixed longitude to be crossed, with some sign tweaks to ensure continuity. These tweaks imply the increasing flag in events detection becomes irrelevant here! As an example, the longitude of a prograde spacecraft will always increase, but this g function will increase and decrease so it will cross the zero value once per orbit, in increasing and decreasing directions on alternate orbits. If eastwards and westwards crossing have to be distinguished, the velocity direction has to be checked instead of looking at the increasing flag.

        Parameters:
        s - the current state information: date, kinematics, attitude
        Returns:
        longitude difference between the spacecraft and the fixed longitude, with some sign tweaks to ensure continuity