2

Im trying to create a 3D scene in JS/React where I can plot the orbit of the ISS around earth, I've currently forked this repo https://github.com/dsuarezv/satellite-tracker

Ive noticed that this only seems to display ground tracked orbits, what I want to do is display a full orbit which isnt ground tracked i.e. its a circle and the start and end meet. With this I will also rotate the earth at an appropriate speed to replicate real time accuracy. All data for path are generated from a tle file using satellite.js propagate function to get xyz coordinates to display.

How would you convert an orbit displayed as a ground track to a full orbit with a rotating globe?

From this:

Ground tracked ISS orbit displayed on a globe

To this:

ISS orbit around the earth

MacaScull
  • 161
  • 1
  • 10

2 Answers2

1

I'm not familiar with satellite.js, but the issue you are having is that you want to draw the orbit in an Earth Centered Inertial (ECI) frame and not Earth Centered Fixed (ECF). Each time you get the position of the satellite you need to get it in an ECI frame like J2000 or ICRF. If you are propagating a TLE for the ISS then the output of the SGP4 propagator is TEME of Date, also an inertial frame. Draw your points/lines using the ECI coordinates and you should be good to go.

Tom Johnson
  • 1,793
  • 1
  • 13
  • 31
  • I've converted the data returned into ECI so now any data displayed will be in ECI, though this slowly becomes out of sync for some reason, could this be because of old tle files? I thought might be due to data being passed to the propagate function or the data being passed – MacaScull Mar 08 '22 at 15:59
  • Not sure what you mean by "out of sync"? A TLE, particularly for a LEO like the ISS, is only valid for a few days because the SGP4 force model isn't perfect and slowly diverges from reality (all force models have this issue, some more than others). So if you want to represent where the ISS is over a 30 day period, you'll have to use all the TLEs with epochs in that time frame, and switch from one TLE to another as you move through the period. – Tom Johnson Mar 08 '22 at 17:58
  • So what I mean by out of sync is that, at one moment in time looking at my system and the NASA ISS tracker, both positions will match in location. But e.g. after 30 minutes the locations will not match. I understand that the TLE is only valid in accuracy for a limited amount of time, that's fine I can create a fetch to grab another TLE but at the moment for some reason they only seem to be accurate for 30 minutes or less like I said. I'm not too certain how to combat this. Any recommendations with the library I linked? – MacaScull Mar 09 '22 at 18:15
  • Within 30 minutes things should stay quite consistent. I'm not a Javascript person, but I took a quick look at the repo. They appear to know what they are doing, so I suspect the issue is on your side somewhere. Not much help, I know. – Tom Johnson Mar 10 '22 at 20:05
  • They do thats why Im trying to use this library, though the only two/three things Ive actually added into the code was the transformation into ECI instead of ECF, the initial rotation (accurate current earth rotation) and rotation adjustments over time. These issues that im facing seem to have no real explaination, as I dont think my additions would cause this. Thanks for the help though. – MacaScull Mar 12 '22 at 21:21
1

The point is, that you need the ISS' position in ECF reference frame. The Orbit on your first image is correct and shows the position of the ISS at the corresponding point in time.

The trick is to propagate the orbit using the predicted orbit time but convert it to ECF using the current time of the scene (by using the same gsmt time for the whole orbit). This way you'll get a rotating orbital plane instead of a prediction of the ISS' positions.

Be aware that this orbit does NOT show the correct path of the spacecraft unless the earth is rotating. This is why the orbit is changing with every movement of the SC.

Fabian Witte
  • 61
  • 1
  • 5