Altitude Check in GroundFieldOfViewDetector

Greetings everyone,

I have a Python code that finds the access times of a satellite to a FOV extending from a ground based station into the space. Setting up a proper frame for this FOV, one can use GroundFieldOfViewDetector to calculate these access times.

However, using this method we have a FOV infinitely extending into the space. Say, I want to limit my FOV’s space projection to 1000 km. Is this possible with any method that Orekit already has?

Thank you for the valuable discussion!

Kind regards,
Baris

Hi @Echulion,

You can wrap your GroundFieldOfViewDetector into an EventEnablingPredicateFilter with a custom EnablingPredicate to filter out events occurring beyond the maximum allowable distance between the spacecraft and the FOV location.

Hello @pascal.parraud,

Thank you for your reply and advice. Although what you propose sounds quite easy, I have no notion about how to implement this. So this is the class you’ve told me about:

EventEnablingPredicateFilter(T rawDetector, EnablingPredicate<? super T> enabler)

If I understood you correctly, rawDetector is supposed to be my GroundFieldOfViewDetector . And then I should set up my EnablingPredicate. It is as follows:

eventIsEnabled(SpacecraftState state, S eventDetector, double g)

so this also requires an event detector right? Though there isn’t one that calculates allowable distance between s/c and FOV events. This is the point where I am confused. Should I use something like FunctionalDetector as my custom event detector?

Thank you in advance for any further explanation and your time!

Hi @Echulion,

The following Java code for a class extending the EnablingPredicate interface is a suggestion that should meet your needs, under the assumption that the FoV is located at the origin of the linked frame:


    class DistanceFilter implements EnablingPredicate {

        private final double maxDistance;

        public DistanceFilter(final double maxDistance) {
            this.maxDistance = maxDistance;
        }

        public boolean eventIsEnabled(SpacecraftState s, EventDetector d, double g) {
            Vector3D p = s.getPosition(((GroundFieldOfViewDetector)d).getFrame());
            return p.getNorm() < maxDistance;
        }

    }

Since it looks like you’re using the Python wrapper, which I’m unfortunately not very familiar with, I guess you’ll have to implement the Python class PythonEnablingPredicate in a similar way, taking care to cast, in the eventIsEnabled method, the raw EventDetector to a GroundFieldOfViewDetector, casting being safe in this case.

The calling code (in Java, sorry) would be something like that:

   FieldOfView fov = ...
   Frame fovFrame = ... // a TopocentricFrame ?
   GroundFieldOfViewDetector fovDetector =
                new GroundFieldOfViewDetector(fovFrame, fov);
   double maxDistance = 1000000.0; // 1000 km
   EnablingPredicate predicate = new DistanceFilter(maxDistance);
   propagator.addEventDetector(new EventEnablingPredicateFilter(fovDetector, predicate));