Repository navigation
Fix for erfa 1.7.2 - #11485
Fix for erfa 1.7.2#11485
Conversation
|
👋 Thank you for your draft pull request! Do you know that you can use |
|
I'm very confused by this myself, not least how this test passed in previous releases. I'm on astropy 4.2.1 and it is 489.6" away from the pypehem value and 521.28" away from the "current" astropy result. BTW if you take the "expected" RA/Dec from PyEphem and transform it into the altaz frame with astropy you get <SkyCoord (AltAz: obstime=2011-09-18 08:50:00.000, location=(-1774037.41919622, -5033515.95039486, 3535095.77328894) m, pressure=1010.0 hPa, temperature=15.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt) in deg
(6.89010736, -60.74182357)>If you do the same thing with SkyField you get We seem to have a bigger problem with altitude. Skyfield gets this about right, but we are quite far off. Things aren't improved in astropy master c.f 4.2.1 (master uses the direct ICRS->AltAz transform). However, I still haven't understood why |
|
@adrn has a weekly |
|
Next week we're doing the triaging meeting (right?), so I added this to the agenda for Apr 19! |
|
It is worth discussing, but I think the issue is to do with an abuse of the atmospheric refraction code. It isn't really designed to work at altitudes of -60 degrees! If you turn off atmospheric refraction the disagreement drops to 4.5 arc seconds! |
|
By the way I'm ok with the changes in this PR, and happy to approve, but I think we should clear up why this test is failing now and how it passed in prior releases before merging. |
Ah, yes. I was gonna get in touch with you about it today. Let's take this part offline. |
|
Hmm, I don't think we have to expect to reproduce altitudes well below the horizon! Surely that is a mistake! (But let me ping @cdeil who put in this test). I think I'll just run |
|
OK, I made a commit where I changed the |
|
|
||
|
|
||
| @pytest.mark.parametrize('icoo', icrs_coords) | ||
| def test_icrs_consistency(icoo): |
There was a problem hiding this comment.
I have no idea why the test as written iterated over all the SkyCoord rather than just do them in one go. Changes testing time from ~10 s to <1 s.
|
So I've approved this PR because the code is absolutely fine. With regards to whether we can require pyerfa>=1.7.2 I personally do not see any problems this could cause with LTS. However, maybe we should ask someone who actually has to package these things, like @olebole ? |
|
Note that I can quite easily change it such that the code becomes erfa-version dependent (like we do for numpy). |
|
@StuartLittlefair Debian is currently in Hard Freeze for the new release 11 "Bullseye"; therefore I will not upload anything unless it fixes a release critical bug. And for our new release cycle, requiring >= 1.7.2 is absolutely fine -- 1.7.2 is what we will have in Bullseye, so it would even not prevent backporting. |
3a6839e to
7d9da0f
Compare
|
OK, I think for 4.3 we should just require erfa >= 1.7.2. I had worried about 4.0.x, but since Since this was approved before, I'll merge once tests pass again - that's helpful too for getting pyerfa 1.7.3 out - this time I'll test it works with astropy before releasing! |
This fixes most of the problems with ERFA 1.7.2, following the suggestion of @mkbrewer to adjust
erfa_astrom.apioto follow the update in ERFA itself. With that, we're internally consistent.I'm a bit puzzled, though, by the remaining failure, which is a comparison against pyephem. Note that the actual failure is against an earlier astropy result, but why is it off by so much? Also comparing directly to the pyephem result, we're also off by a large amount (490"), much larger than used to be the case.Now I noticed one strange thing with that particular test, which is that the height is 30000 m. However, a quick check with 30 m did not help. (link to test below)EDIT: as noted by @StuartLittlefair below, the really strange number is the input altitude of -60 degrees! With that more reasonable, things pass.
Also a question: should I make
apioERFA-version dependent, or can we simply insist on a recent ERFA version (I think definitely OK for 4.3, but what about LTS?).See
astropy/astropy/coordinates/tests/accuracy/test_altaz_icrs.py
Lines 94 to 127 in fff5ccf