Repository navigation
Implement framework for observed hour angle-declination transforms. - #11676
Conversation
|
Hello @mkbrewer 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style. There are no PEP8 style issues with this pull request - thanks! 🎉 Comment last updated at 2021-05-20 23:41:13 UTC |
There was a problem hiding this comment.
Welcome to Astropy 👋 and congratulations on your first pull request! 🎉
A project member will respond to you as soon as possible; in the meantime, please have a look over the Checklist for Contributed Code and make sure you've addressed as many of the questions there as possible.
If you feel that this pull request has not been responded to in a timely manner, please leave a comment mentioning our software support engineer @embray, or send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
mhvk
left a comment
There was a problem hiding this comment.
This PR looks very good. I think the repeated tests probably cover most cases, but I wouldn't mind one or two simple tests that explicitly show that for some inputs, the HA and Dec are as expected (could be observing something near Spring equinox and showing that sources with RA12 are at HA0 at mightnight, and that their Dec is close.
Also, I think some documentation would be good - though I'm not 100% sure where it would be best.
|
I just want to say that I will get round to reviewing this ASAP, but I am under a lot of work pressure until May 15th, so probably not before then. |
|
Regarding tests for accuracy, my point is that these would be redundant. For instance, if |
|
@mkbrewer - OK, I rebased to get rid of the merge conflicts and made the simplification I suggested. I also took the liberty to squash the multiple smaller commits. Locally, the tests pass, and on second thought I agree with you that there is not much point in separate precision tests. What still would be good, I think, is to have at least a simple example somewhere in the documentation, like (where I verified the result with the veritable |
|
Regarding documentation, can you handle that? I can't find any similar example for either |
|
@mkbrewer - hmm, you're right, it is actually far from obvious where a simple example about how to use I think otherwise this PR is in very good shape, though ideally @StuartLittlefair has a look as well (@StuartLittlefair - the addition is actually as simple as @mkbrewer had promised it would be). |
Co-authored-by: P. L. Lim <[email protected]>
…pelling in AltAz.
|
@StuartLittlefair - would you have some time to review this HADec implementation? |
There was a problem hiding this comment.
Thanks so much @mkbrewer and @mhvk.
As you promised @mkbrewer the fix here is very straightforward and nicely implemented. I'm really sorry we didn't get round to implementing it, and that review took me so long.
I've got no issues with the code here at all, but I think what we are missing is a single test that a conversion into the new HaDec frame gives the "right" answer.
I don't think an explicit test of the HaDec results is necessary - the transform code is well tested by the AltAz tests and I think that any silly changes to the codebase would break the round-tripping that is tested. We'll just have to be careful to implement such a test if anyone ever splits the AltAz and HaDec transforms - perhaps if we ever move away from erfa, for example.
I've approved this PR, so it could be merged, but there's a very minor tweak to the what's new entry that I'd like if @mkbrewer approves
| assert_allclose(hd1.dec, hd2.dec) | ||
| assert_allclose(hd1.ha, hd2.ha) | ||
| assert_allclose(hd1.dec, hd3.dec) | ||
| assert_allclose(hd1.ha, hd3.ha) |
There was a problem hiding this comment.
@mkbrewer - to address @StuartLittlefair's larger comment, I'd suggest to here also check the numerical values of one of these three, just to ensure we do not later do something silly that makes, e.g., HADec be just an alias for AltAz (as is, I think all the tests would pass if one were to do that!).
There was a problem hiding this comment.
OK. I'll go ahead and create a precision test.
|
OK. I've added a test. I'm likely to be tangled up in units though. Does |
|
@mkbrewer - yes, with units those things should "Just work"! The changes look good, and I'll get this in once the tests pass. Thanks again! |
|
Sadly the new test fails... |
|
OK, it is just a different wrapping of |
|
OK, I pushed a fix, and also added a test that does not rely on remote data - using the "overhead" test so that the answers are known to be right by inspection. Will merge if tests now pass. |
|
@mhvk Hour angle always ranges from -12 to +12. |
|
Yes, I felt that made more sense, but that is not what your |
Plus a small name change to make a test more logical.
|
That's odd. Both |
|
@mkbrewer - the problem is that the Anyway, I think the current fix is the best we can do without a more general solution... And since tests pass, I'll merge it. Thanks again! |
Description
This pull request is to address my request in issue #10239 for an observed Hour Angle/Declination frame to complement the AltAz frame. It's been a year now since I made this request and nothing has come of it, so I felt that it was necessary to take matters into my own hands. I have included a few basic tests here. Since the code is basically the same as that for AltAz, I don't think it is necessary to test for accuracy other than these. I did need to change the name of one existing test:
test_icrs_consistency()totest_icrs_altaz_consistency(). I'm sure that there is likely to be some "glue" that I have neglected here and could use some help with that. I have made no attempt at amending the documentation as I wouldn't know where to begin with that. Also, I neglected to add [skip ci] to my commit message. Sorry about that.