Simultaneous Observations Step Selector

Hi All,

I am attempting to make a quick code in which I use a field of view detector to check for which planets are in view for a spacecraft. Each one requires its own step selector and as I understand each will produce observations of planets which begin as soon as they are in view.

What I would like to do is the flip of that. I would like to take observations of whichever planets are visible at a fixed interval, ie every x seconds check the field of view for visible planets. Is this possible using eventhandler and detectors or am I better off using a slave mode propagator and doing the math to find visibility for myself?

Thanks so much for all your continued help and for the great project!
Paul

Hi Paul,

Thank you for this! On behalf of the whole community and all the developers if I may.

Now to your question: I’m not sure you can use the EventHandler logic to do it.

But for a quick code you can use the detectors and call their g functions at each propagation step (see FieldOfViewDetector.g).
If g is positive, the planet is in the field of view, otherwise it is not.

It will be overshoot though, since the detectors will still be computing the events when you don’t need them.
To optimize your code I think you’ll be better off copy/pasting the code of the g function in your own piece of code.

Also it will be more efficient to use master mode and an OrekitFixedStepHandler than slave mode.

Hope this helps,
Maxime

1 Like

This is not mandatory. You can create an event detector just in order to call its switching function g from a step handler and not register it as a step detector in the propagator. Then, only your code will call it, there will not be any overhead.

Ah yes you’re right Luc thank you. I didn’t think of it.