Hi forum
I would like to ask what is your approach to detect contact between satellites and ground points for geostationary orbits.
In this case, the ElevationDetector is always returning g function positive (or negative) and as it does not change the sign, the event is not detected.
Is there any solution to catch this use case?
Thanks!
I don’t fully understand what you’re trying to achieve. Do you want to know when the satellite is above (i.e. at the zenith of) a ground point ?
An ElevationDetector with a very high elevation threshold could maybe work.
Or a GeographicZoneDetector with a very small ground zone around your ground point.
Hi @MaximeJ
Thanks for getting back to me quickly.
So my use case is:
ground point
satellite in geostationary orbit (let’s assume perfectly geostationary, no perturbations)
I add an ElevationDetector to capture if the ground point sees the satellite (with elevation margin 0 deg)
Now we have two conditions:
if ground point sees the satellite, g function will be > 0 for the entire propagation window
if ground point does not see the satellite, g function will be < 0 for the entire propagation window
Either ways, as it is a constant condition (perfect geostationary orbit), no event is detected as the g function does not change sign.
So checking the propagator EventLogger does not contain any detected ElevationDetector events. I would then assume that my point does not see the satellite, while actually it could.
So my curiosity is about, do we have any mean to capture visibility of a geostationary satellite? As apparently the ElevationDetector cannot catch it?
(or maybe I am doing something wrong?)
Ok I see @alberto I was completely off-topic sorry
You are right.
Maybe you could extend the elevation detector and work with its init function. Calling g here will allow you to log the “initial” event depending on the sign of g ?
I haven’t tried it though.
Indeed the post you linked seems to be exactly what you need, nice catch.
I didn’t think of the AdapterDetector and the problem with the withXXX methods !
I notice that actually, using the debugger, the code never run the lines with the @Override of the init.
It does pass through the @Override of the init adding to the propagator directly the AdapterDetector, so: propagator.addEventDetector(logger.monitorDetector(elevationDetector)));
But in this case, I have regression issues as other ElevationDetector tests with LEO orbits are failing as no events are captured, it seems that
It is normal you don’t get an event. Events are triggered when the condition changes.
A geostationary satellite does not move with respect to Earth, hence you can check if it is visible or not at init time, but you will never get an event.
Thanks
So there is no actual mean to force the EventDetector to log an event, but it is only based on g function sign change.
The workaround I can think is to check after the propagation if the g function is indeed positive at the initial state s0 and at final state sf.
Something like:
if (elevationDetector.g(s0) > 0) {
//Do something
}
if (elevationDetector.g(sf) > 0) {
//Do something else
}
This workaround works for my application.
Thanks
Alberto
I made it work, it is the monitored event that needs to be adapted, not the “raw” event.
Here’s a piece of code based on your example above.
// "Raw" detector
ElevationDetector elevationDetector = new ElevationDetector(
60.0,
1e-4,
topocentricFrame)
.withConstantElevation(0.0)
.withHandler(new ContinueOnEvent<>()));
// Monitor this detector, this uses the "LocalHandler" from "EventsLogger"
EventDetector monitoredElevationDetector = logger.monitorDetector(elevationDetector);
// Adapt this monitored event detector
AdapterDetector adaptedMonitoredElevationDetector = new
AdapterDetector(monitoredElevationDetector) {
@Override
public void init(final SpacecraftState s0,
final AbsoluteDate t) {
getDetector().init(s0, t);
// This below will call EventsLogger.LocalHandler.eventOccured
// Which will in turn call EventsLogger.LoggingWrapper.logEvent
eventOccurred(s0, g(s0) > 0);
}
};
// Add this last event detector to the propagator
propagator.addEventDetector(adaptedMonitoredElevationDetector);
@MaximeJ I confirm it works!
so no wonky workaround with initial and final SpacecraftState but I can capture the event at the beginning of the propagation.