-
Notifications
You must be signed in to change notification settings - Fork 101
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
Faster implementations of astrometric ssb calculations #1646
Conversation
There are tests to check accuracy. Finding differences of ~few * 1e-16 compared to the astropy versions. But the speed up is a lot.
So looking at the native components is very fast. But even when converting it's still a factor of 3-4. |
Test script:
|
It will still fall back to the older calculations if it needs a different obliquity. |
A number of tests are failing. Some have to relate to tests that compare the analytic parameter derivatives with numerical versions. As far as I can tell, the analytical versions of those are essentially unchanged with this PR, but the numerical versions change appreciably. I don't know if anybody (@scottransom , @paulray ) has any ideas about that part, since they predate me. |
the latest tests work fine on a Mac, but fail on ubuntu. not sure why. changing the tolerances |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1646 +/- ##
==========================================
+ Coverage 68.34% 68.39% +0.04%
==========================================
Files 104 104
Lines 24112 24142 +30
Branches 4280 4285 +5
==========================================
+ Hits 16480 16511 +31
Misses 6547 6547
+ Partials 1085 1084 -1
☔ View full report in Codecov by Sentry. |
So it appears that the
so it will return the delay with or without the explicit parallax term. If I do this for a model I find that the value for a model with PX=0 matches that for a model with PX>0 if the explicit parallax term is ignored. But that with the explicit parallax included they don't match by an amount proportional to parallax. |
That said, if I leave the parallax out of the |
I don't think that this is doing the parallax wrong or double. What I did was measure the parallax residual amplitude as a function of ELAT and compare with the prediction. (Note that I think the prediction from the HBOPA is wrong: it should be |
P.S. it deviates at high |
P.P.S. Michael K has confirmed that there is a typo which is now fixed. |
As far as I can tell from this:
the |
Yes, I think that's the case from https://github.com/liberfa/erfa/blob/master/src/starpm.c#L130. So the parallax is only used to get a distance (which can change with the RV) but not an astrometric offset. |
OK... I am convinced that this is doing the right thing. I'll merge this if that's OK. |
I'm ~99% sure this is good. I think we should merge since this is blocking other things, and if needed can fix later. |
This updates the
ssb_to_psb_xyz_ICRS
andssb_to_psb_xyz_ECL
implementation to be a lot faster while preserving accuracy. It avoids unnecessary coordinate construction/conversion and uses the erfa functions directly.Specifics:
Astrometry
model,ssb_to_psb_xyz_ICRS
explicitly converts coordinates to ICRS but only atPOSEPOCH
(since we cannot be use what the base system is). Then the rest of the calculations are faster. This will also be used forAstrometryEcliptic
models.AstrometryEquatorial
model,ssb_to_psb_xyz_ICRS
skips the conversion as it assumes things are already in ICRS. Then the calculations are even faster.AstrometryEcliptic
model,ssb_to_psb_xyz_ECL
skips the conversion as it assumes things are already in ECL. Then the calculations are even faster.