-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Error in ecliptic_latlon
method of position objects
#208
Comments
It looks like this is the same error that's causing #207. |
It looks like it might involve @GammaSagittarii's code that tries to make the ecliptic coordinate system of different dates available. I'll go take a look and at least commit a test showing that Skyfield is broken until this gets fixed! |
Here's that commit, so that I can find the link again easily if I need to: |
Until this is fixed, the build should be broken.
I've just released Skyfield 1.9 with this fix. Thanks for the report! |
I am really sorry for this mess, I should have written more tests along with my code. |
@GammaSagittarii — I hope you are happy that you added a whole new feature, and even in tweaking your code I kept the essential bit you added, by knowing which of the Earth rotation attributes is essential to ecliptic coordinates! Getting coordinate operations written so that they work for both individual times and arrays of times is VERY fiddly, and it was only by drawing on years of experience doing it in Skyfield that I knew how to pivot the code. Next time, we'll write a few more tests and raise the bar. But for now your feature is rescued and should give everyone good results! |
Of course I am happy, but I still felt embarrassed, @brandon-rhodes thank you for your encouraging words! I think I still have this implementation of precession calculation for long time intervals - from this paper https://www.aanda.org/articles/aa/pdf/2011/10/aa17274-11.pdf . I haven't made a pull request for it, because it is not working with arrays of times obviously :D . |
I'm not sure whether we can port code from SOFA. I have always pulled code from USNO NOVAS and from the JPL SPICE toolkit instead, and I think it will be safest for Skyfield if we continue that tradition. Can you find any other implementations of that paper's code that aren't part of SOFA? If not, then I'd recommend you release your Python version as a separate package. Skyfielders who wanted to use it would simply |
OK, so it turns out there is already published code on PyPi (https://pypi.org/project/vondrak/) by @nebulousdog so I think publishing my version would be redundant. Unfortunately his code also contains functions from SOFA, and also needs to be modified to work for arrays of times if it was to be option for Skyfield. I have not found any other implementations, aside from the original one in the paper that is in Fortran, but that one does not have any license stated explicitly, and it also uses a few sofa functions, although I think they can be avoided by using numpy, or Skyfield functions. So with everything as it is, I think I will leave it be. |
Okay, that sounds like a reasonable approach for now — I'll let you know if I run across other implementations that are independent! |
To recreate the error first initialize some objects:
Here are the results when I call the
ecliptic_latlon
method using a few differentTime
objects:As far as I can tell it works when
Time.tt
is either a float or an array of size 3, but not otherwise. The traceback is the same for each of the above two exceptions:The text was updated successfully, but these errors were encountered: