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

Support for SPK Segment Type 10 #66

Open
dahlend opened this issue Jul 1, 2024 · 7 comments
Open

Support for SPK Segment Type 10 #66

dahlend opened this issue Jul 1, 2024 · 7 comments
Labels
backend Issue in the rust backend bug Something isn't working enhancement New feature or request

Comments

@dahlend
Copy link
Collaborator

dahlend commented Jul 1, 2024

Hubble's spice kernels are of SPK Segment Type 10, I now have an example to add support from:

kete.spice.kernel_fetch_from_url("https://naif.jpl.nasa.gov/pub/naif/HST/kernels/spk/hst.bsp")

@dahlend dahlend added bug Something isn't working enhancement New feature or request backend Issue in the rust backend labels Jul 1, 2024
@dahlend
Copy link
Collaborator Author

dahlend commented Jul 9, 2024

I have had loading of these files working since sunday afternoon, however there is a discrepancy between neospy and SPICE.

A few things that I have discovered which are incorrect in the SPICE file for hubble:

  • There are at least 2 epochs where the TLE have been incorrectly saved. These are visible in the plot below as large spikes. These spikes are visible in my implementation as I have not included the interpolation between neighboring TLEs which SPICE uses. The TLEs vary relatively slowly, meaning that they can be interpolated well. However if there is a large difference from one TLE to the next then the error between interpolation vs not interpolation will get worse, and then get better again as it moves over the bad data point. Because I am not interpolating yet, this error is extremely visible. If I had implemented interpolation then these discrepancies would not be visible. The "smearing" of the differences, IE, the visible banding of the error is what should be expected for the difference from interpolation vs not interpolating.

  • Hubble file contains 5-6 Earth gravitational constant terms which are out of date, and not what are used by other agencies. Specifically they are not using the WGS84 standard which is the expected values for the provided TLEs. I have compared the TLEs present in their spice file against the external source of this information and they match precisely, meaning these constants are not being recorded correctly.

The main issue:

After spending a few hours on this I believe there is an error in time conversion, and I am somewhat certain that this conversion is incorrect in cSPICE itself. Much of this error may be fixed by applying a small linear offset to time which causes about a 3 second offset in 2024 vs a 0 second offset in 2000. I am currently trying to diagnose the source of this, I have checked and validated that my time conversion matches cSPICE time conversion to the microsecond level.
image

EDIT:
I am using an external library to analyze the TLEs, which has been validated to match the official standard TLE implementation to the expected numerical precision of the TLE format. I trust this source of the computation far more than the implementation present in cSPICE.

@dahlend
Copy link
Collaborator Author

dahlend commented Jul 9, 2024

I will continue to work on this on my own time, but I will merge what I have for now, as it is mostly working, if not at 100%.

@dahlend
Copy link
Collaborator Author

dahlend commented Jul 9, 2024

For a point of comparison, here is the same plot for the difference of earths position in spice vs neospy, less than about 100 micron:
image

@joemasiero
Copy link
Collaborator

I think these spikes correspond to the space shuttle servicing missions. They boosted the orbit right around the same time you're seeing the spikes, so that might be why there are differences?

@dahlend
Copy link
Collaborator Author

dahlend commented Jul 9, 2024

Good catch, servicing mission near may 11 2009
image

@dahlend
Copy link
Collaborator Author

dahlend commented Jul 9, 2024

Pretty sure their interpolation fails near those dates due to interpolation being a bad move for discontinuous events.

@dahlend
Copy link
Collaborator Author

dahlend commented Jul 9, 2024

Here is a more detailed plot showing the effects of interpolation, the minimums in the sin waves are when exact dates are saved in the spice kernels. The overall offset of about 17km is the underlying time conversion issue.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issue in the rust backend bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants