Repository navigation
Direct icrs altaz - #11079
Direct icrs altaz#11079
Conversation
mhvk
left a comment
There was a problem hiding this comment.
This looks good modulo some comments to avoid copies (which are not going to matter much, but one might as well). It seems surprising that the speed-up is relatively minimal. Are we missing something? Though looking at some quick timings, I guess it is just that CIRS->AltAz is just much more expensive.
p.s. The failures all seem directly related to the PR, but the fact that you get local failures is a bit worrisome.
|
Quick work @mhvk! This is a little faster now as a result: The local test failure is quite odd. I see it in the current astropy master as well. I don't know why, but I'm going to start by cleaning out all of my anaconda environments. |
|
Well, hardly worth the 0.5% improvement in timing, but if anybody has very large arrays of |
|
Just a little suggestion. You could call this |
|
Of course, this applies to the reverse transform also. |
This is a neat idea. I'll get to this tomorrow, but JWST deadline needs to take priority for now. |
|
Actually, this needs a changelog entry (or |
|
Just trying to kill two birds with one stone here. |
|
Which is a good idea, but even though the code is, as you note, easy, writing the test cases and documentation will mean it will take a couple of hours, so might as well get this in... |
This PR fixes #10887 by implementing a 'direct' transformation between ICRS and AltAz. In fact, this transform routes via CIRS, but by doing it in one routine we avoid the overhead of computing the astrometry context twice, and the overhead in creating a SkyCoord object for each step.
This results in a modest speedup. Running @maxnoe's performance profiling from #10647 (comment), we find:
compared to the current master:
The only remaining puzzle is that I am unable to reproduce the high precision for GCRS->AltAz introduced in #11073. What is a mystery is that the transforms in that test are unaltered - they still go through the untouched GCRS->CIRS->AltAz chain. So I am submitting this PR to see if tests pass remotely and the local failure is something to do with my setup.