Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velocity of Earth Satellite Loaded from TLE #187

Closed
dsholes opened this issue Jul 3, 2018 · 4 comments
Closed

Velocity of Earth Satellite Loaded from TLE #187

dsholes opened this issue Jul 3, 2018 · 4 comments
Assignees

Comments

@dsholes
Copy link

dsholes commented Jul 3, 2018

I'm trying to get the velocity of an EarthSatellite loaded from a TLE. For example:

from skyfield.api import Topos, load
import numpy as np

ts = load.timescale()
stations_url = 'http://celestrak.com/NORAD/elements/planet.txt'
satellites = load.tle(stations_url,reload=True,)
cubesat = satellites['FLOCK 2K-08']
t = ts.now()
print(cubesat.at(t).velocity.km_per_s)

But this returns [0., 0., 0.]. Note that cubesat.at(t).position, cubesat.at(t).subpoint() both behave as expected. Am I misunderstanding what cubesat.at(t).velocity is supposed to return?

@brandon-rhodes brandon-rhodes self-assigned this Jul 4, 2018
@brandon-rhodes
Copy link
Member

Velocity is not yet supported; when I wrote that code, I knew how to rotate the position into GCRS coordinates, but not how to rotate the velocity:

        rITRF, vITRF = TEME_to_ITRF(t.ut1, rTEME, vTEME)
        rGCRS = ITRF_to_GCRS(t, rITRF)
        vGCRS = zeros_like(rGCRS)  # todo: someday also compute vGCRS?

If the holiday tomorrow gives me some free time, I might look at whether I can figure out the transformation and return something other than zeros!

@brandon-rhodes
Copy link
Member

Oh — I should ask for a clarification: are you interested in the satellite's velocity relative to a non-rotating observer watching the rotating Earth from a distance? Or in its velocity relative to a location on Earth which is itself veering constantly in a circle at high speed?

@dsholes
Copy link
Author

dsholes commented Jul 4, 2018

Thank you for the quick response! I'm interested in its velocity relative to a location on earth. I think vITRF would be enough for me, but since you're returning everything else in GCRS, it would be nice to have that as well.

By the way, I think it has already been asked in Issue #85, but is there a reason you don't offer a method to return rITRF and vITRF, considering you're often already calculating them?

I'm new to skyfield but I'm really enjoying it so far. The code and documentation is very clean and easy to follow. Thank you for all of your work!

@ghost
Copy link

ghost commented Jul 6, 2018

The SPICE routine xf2rav() may be helpful here. It's documented at:

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xf2rav_c.html

and should be available in the source code. It's description is "This routine determines a state transformation matrix from a rotation matrix and the angular velocity of the rotation."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants