BooleanDetector.andCombine cannot be effective?

Hello,everyone! I’m having this problem:The following code does not take effect
final EventDetector sta1Visi1 =
new ElevationDetector(maxcheck, threshold, sta1Frame).
withHandler((s, detector, increasing) → {
System.out.println(" Visibility on " +
detector.getTopocentricFrame().getName() +
(increasing ? " start " : " end ") +
return increasing ? Action.CONTINUE : Action.STOP;
final EventDetector sta1Visi2 = new ElevationExtremumDetector(maxcheck, threshold, sta1Frame).withHandler(new VisibilityHandler());
BooleanDetector combined_detector = BooleanDetector.andCombine(sta1Visi1,sta1Visi2);
EventsLogger logger = new EventsLogger();
EventDetector logged_detector = logger.monitorDetector(combined_detector);
tlepropagator.addEventDetector(logged_detector );
but,The following code works correctly:

Hello @hurricane313622,

This will trigger and event when your satellite is visible from both stations at the same time.
That may be why it doesn’t work. Maybe this never happens ?

What exactly are you trying to achieve ?

1 Like

Oh thank you so much, I finally get it, you’re right!
I want to get a station in and out of time, and I want to get the highest elevation angle. But I don’t know what to do.

I read your post and I know how to do it(
The result is as follows, where Article (2) is not what I want, I know because withConstantLeverage (FastMath.toRadians (3.0)) is not used, but ElevationExtremumDetector does not support withConstantLeverage methods.

(1)2022-09-09T07:18:42.38290609907256Z max 287.505 azimuth 36.697 elevation

(2)2022-09-09T08:51:59.82111314602469Z max 304.052 azimuth 0.696 elevation

(3)2022-09-09T16:26:32.44075435373779Z max 61.580 azimuth 6.640 elevation

Hi @hurricane313622,

I’m not sure I understand exactly what you want but if you want to filter out elevation below 3° you can probably use BooleanDetector.andCombine with your ElevationExtremumDetector and an ElevationDetector.withConstantElevation(FastMath.toRadians (3.0)).

Is that what you’re looking for ?

Also consider the EventEnablingPredicateFilter which is better suited to events such as elevation extrema that are not usually used to define region boundaries the way elevation detector is.

thanks,Disturbing you.I’ll give it a try.