PVCoordinates Provider custom build

Hi Community,

I want to create a Custom PVCoordinates Provider. I have the Cartesian coordinates, the reference frame and the epoch as below. I’m not sure how to create a custom PV provider. can you help on providing the sample code to start with.

here are the details:
PVCoordinates pv = new PVCoordinates(new Vector3D(1.3431, 1.047629, 132.614909), new Vector3D(-1.71e-5, 2.69e-5, -1.74e-5));
Frame frame = FramesFactory.getEME2000();
AbsoluteDate date = AbsoluteDate.J2000_EPOCH;

I need a PVCoordinates Provider to use it eclipse detector for further analysis.

Waiting for your help community. Thanks in Advance

Hi @asuthoshcr,

What kind of PVCoordinatesProvider would you like to create ?
A basic provider with Keplerian propagation ? Or something more complex ?
For Keplerian propagation you can use the Orbit class which implements the PVCoordinatesProvider interface.
So basically…

Orbit orbit = new CartesianOrbit(pv, frame, date, µ)

…should be enough.

Hi @MaximeJ ,

Thanks. A basic provider is enough for my case. I tried the steps you provided, and it helps for me.

Thanks again :slight_smile: :rocket:

Hi Community and @MaximeJ,

Just a curious question,

Is it possible to provide multiple PVCoordinatesProvider as a input to EclipseDetector instead of writing same cases for different targets? (in my case more than 20)?

Thanks in advance.

Hi @asuthoshcr,

I don’t think so. I’m wondering what would be the use case ? Multiple occulted bodies, or objects like spacecrafts maybe ?

yes @MaximeJ the use case is Multiple occulted bodies. To reduce the number of lines in the code I’m trying to understand if there is any way to provide multiple occulted bodies into one eclipse detector.

No, there is no way to do that and indeed it would not work.
The event detectors need to keep some kind of state, in order to be aware when sign change between two checks and launch a root finder. As multiple occulting bodies implies multiple independent states, it seems better to have one detector dedicated for each body.

Thanks @luc . Well understood.