[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Inertial Frame Question




Stephen Ranger <sanosuke001@gmail.com> a écrit :

Hello,

Hi Stephen,


I'm attempting to plot the positions of objects based on a current
visualization time (the time my Inertial Frame should be based on; I
believe) with each incoming fixed-frame position also having a time but
potentially different from the visualization time.

When you talk about fixed frame, do you mean fixed with respect to Earth
(i.e. rotating with respect to the rest of the unisverse)?


My question, if I make a new transform from fixed to inertial (ITRF to
EME2000) with the current visualization time how do I then get the position
of my incoming object at it's past or future time?  Is it as simple as
making a new transform for the object's time from the fixed frame or do I
need to get a transform from the visualization time's inertial frame to the
past/future inertial frame?

Yes. The most accurate and more straightforward way is to compute the transform
at each date, by the getTransformTo method from Frame. The Transform instance
obtained this way is valid at the time you give and not for neighbouring times.

The Transform instance should be considered a temporary object created and
destroyed on the fly during computation.

A lot of work has been put to make the getTransformTo method very efficient,
as there is a lot of caching underneath, so you don't have to attempt to do
caching or interpolation at your use code level. You can rely on the method
being really fast.


Sample code or a tutorial somewhere would be helpful but an explanation of
the "right" way to transform position information would be useful, too.

I would suggest something like:


  // These are the things that give you your obects positions
  List<PVCoordinateProvider> myObjectsProvidersInITRF = ...;

  while(stillRunning) {

java.util.Date now = Calendar.getInstance(TimeZone.getTimeZone("Etc/UTC")).getTime();
    AbsoluteDate absNow = new AbsoluteDate(now, utc);
    Transform itrf2Eme2000 = itrf.getTransformTo(eme2000, absNow);
    for (PVCoordinateProvider provider = myObjectsProvidersInITRF) {
       PVCoordinate pvITRF = provider.getPVCoordinates(absNow, itrf);
       PVCoordinates pvEME2000 = itrf2Eme2000.transformPVCoordinates(pvITRF);
       display(pvEME2000);
       try {
           // wait 100 ms
           Thread.sleep(100);
       } catch (InterruptedException ie) {
         // ignored
       }
    }

  }

In this example, I suppose that your providers naturally provide data in ITRF frame, so it is better to compute itrf2Eme2000 once for all objects, at current time. Another approach could alos be to call provider.getPVCoordinates(absNow, eme2000) directly and to not transform the coordinates by yourself, but in this case the equivalent of getTransformTo would be called
under the hood by the provider over and over.

Of course, if instead of a list of PVCoordinateProvider you have your own objects (say a simple ephemeris of already precomputed positions in ITRF), you would just replace getPVCoordinates
by your own API.

Hope this helps,
Luc

Thanks!


- Stephen Ranger