Hello,
I have code to determine the maximum elevation during a ground station visibility period. Within the propagation I’ve provided an ElevationDetector for AOS/LOS times, and a ElevationExtremumDetector for getting the maximum elevation during the individual visibility periods. Since ElevationExtremumDetector passes both the negative and positive extrema I originally simply put an if… statement in the handler to only process elevations that were > 0. This worked just fine.
On looking through posts here I learned about the EventEnablingPredicateFilter and wanted to implement it for this case. I removed the “if” statement from the handler, and created the following:
public class MaximumElevationEnablingPredicate implements EnablingPredicate {
@Override
public boolean eventIsEnabled(SpacecraftState state, EventDetector detector, double g) {
ElevationExtremumDetector elevationExtremumDetector = (ElevationExtremumDetector) detector;
double elevation = elevationExtremumDetector.getElevation(state);
return elevation > 0;
}
}
The filter is added to the propagator as follows:
MaxElevationHandler maxElHandler = new MaxElevationHandler(groundStation);
ElevationExtremumDetector maxElDetector = new ElevationExtremumDetector(groundStationFrame).withHandler(maxElHandler);
MaximumElevationEnablingPredicate maxElEnablingPredicate = new MaximumElevationEnablingPredicate();
EventEnablingPredicateFilter maxElEnablingPredicateFilter = new EventEnablingPredicateFilter(maxElDetector, maxElEnablingPredicate);
propagator.addEventDetector(maxElEnablingPredicateFilter);
This doesn’t seem to work properly. While most visibility arcs have a maximum elevation associated with them, some do not. There doesn’t seem to be any particular commonality between the events without a maximum elevation detected and those with. The ones missed are rather low elevation events (6.1 and 1.1 degrees max elevation) but it catches one that is almost at the horizon (0.8 deg max elevation). The ground stations all have simple circular masks of 0 deg elevation and the satellite is in a LEO orbit, so visibility periods are on the order of minutes.
Am I using the EnablingPredicate interface correctly?