Add Local Earth Rotation Angle. Adjust sidereal time for the TIO.#11680
Add Local Earth Rotation Angle. Adjust sidereal time for the TIO.#11680mhvk merged 14 commits intoastropy:mainfrom
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-22 22:38:01 UTC |
|
The sidereal time checks will likely fail due to the addition of the |
|
I have no idea what this is all about: |
|
Yay! I figured it out. |
mhvk
left a comment
There was a problem hiding this comment.
@mkbrewer - thanks so much for the PR! I had a quick look and see some parts that should fail - did you try it out yourself? Or am I wrong?
Regardless, we will need some tests that check the code works as expected (in astropy/time/tests/test_sidereal.py and perhaps also astropy/time/tests/test_precision.py). Also, we'd need to describe the new method in the documentation, probably easiest in the section about sidereal time, https://docs.astropy.org/en/latest/time/index.html#sidereal-time (which corresponds to docs/time/index.rst). I'm happy to help with both.
I note in-line that a lot of the code duplicates what we just added to erfa_astrom.apio - ideally, we just have it in one place. Though I think it is best to first just get everything working properly.
|
@mkbrewer - I've gone ahead and made sure the code ran and added some tests and documentation. Looking at the code again, I also realized But of course, this means you now better review my contributions! |
|
On your comment on top:
I agree we should provide a way to just get the angle out without the p.s. This reminds me that nominally a string should be an observatory, and we now have |
|
@mhvk I'm afraid that I must disagree with this re-implementation. Just because something can be done, that doesn't mean that it should be done. Sidereal time and Earth rotation angle are different beasties. Allowing the return of Earth rotation angle through the call of a public method called Furthermore, while sidereal time is a general term which can be taken to mean either Greenwich sidereal time or local sidereal time, Earth rotation angle specifically refers to the angle between the CIO and the TIO. As currently written, the method now called My argument for interpreting the string It might be a good idea to accept an |
|
OK, that's fair. I'll revert allowing 'era' in |
|
Oh, one more thing. There is apparently an exception that can occur in |
|
Just to be sure that I understand your suggestion: is it that 'greenwich' will mean just return the output of The former I think is fine, since it means that there is no change from before; the latter probably is OK too. I also like your idea of just allowing one to pass in an |
|
On the exception catching in |
Correct. These are mathematical quantities that are useful for use in other equations by users. |
|
I guess what you're saying is that you'd prefer that the exception not be handled. If so, that's fine. |
|
OK, that means that for 'greenwich', the answer will not change from what it was before. That seems good! |
|
Seems good to me also. Doing otherwise would break code that expects Greenwich sidereal time. |
|
OK, I now also allow |
|
Failure seems unrelated - see #11717 |
Oh, I forgot to address this. I think it is fine, desirable in fact, to allow both |
|
@mhvk @taldcroft In this comment: #11680 (comment) I was asked to catch all strings other than How should this be resolved? |
|
@mkbrewer - as you see, I just reverted that change. @taldcroft's request was logical but clearly neither he nor I realized at that moment that strings were actually generally allowed as input! |
|
Thanks. |
|
@taldcroft Might you be able to give me an estimate of when you will have the time to take a look at this? If so, I'll look back then rather than checking hourly to see if there has been an update. |
|
@mhvk @taldcroft Has this PR somehow fallen by the wayside? I addressed all of the comments and I'd like to be done with this. |
|
@taldcroft - would you have time to look at this Earth Rotation Angle PR again? I think your (good) comments were all addressed, but would rather not dismiss your "request for changes" without you having another look. |
|
@mhvk It's now been a month since @taldcroft 's initial review and still no followup. How long must we wait? |
|
@mkbrewer - let's get it in by the end of the week - I do think it is all OK. (Of course it doesn't really matter in the larger scheme, as it will only get in 5.0, which will be the Fall, but I do similarly like to have things properly off my plate!). |
|
OK, let's get it in! Thanks, @mkbrewer, that was a nice collaboration! |
| string 'greenwich' or 'tio', the result will be relative to longitude | ||
| 0 for models before 2000, and relative to the Terrestrial Intermediate | ||
| Origin (TIO) for later ones (i.e., the output of the relevant ERFA | ||
| function that calculates greenwich sidereal time). |
There was a problem hiding this comment.
I think this should mention that if a plain number is passed, it is assumed to be degrees, which I think is a bit surprising, as plain numbers are usually interpreted as radians, right?
There was a problem hiding this comment.
It is really for backward compatibility for sidereal_time - if I had written this now I would have insisted on a unit (and plain Longitude input does). So, my sense is not to advertise it.
There was a problem hiding this comment.
Wouldn't we allow to change this as this targets 5.0? It seems like a good change to me to require a unit
There was a problem hiding this comment.
Not quite sure whether it is worth it, but I guess we could indeed have a DeprecationWarning starting in 5.0.
There was a problem hiding this comment.
I'm a bit confused by this. The documentation used to say:
The longitude on the Earth at which to compute the sidereal time.
Can be given as a `~astropy.units.Quantity` with angular units
(or an `~astropy.coordinates.Angle` or
`~astropy.coordinates.Longitude`)
In fact, as we found out, one can also use a string (e.g. '10.2345d'). I'm not sure why this was dropped, but the code hasn't changed in that respect. Isn't the Longitude constructor intelligent enough to convert all of these to degrees if given another angular unit?
There was a problem hiding this comment.
Oh, I think I understand. Although this is not mentioned, one can also use a float as the argument, in which case it is assumed to be degrees. I agree with @maxnoe on this. We should have mentioned that in the documentation. Too bad he didn't bring this up a bit earlier. In some respect, I don't think it matters much though. People don't usually specify the longitude of an observatory in radians anyway. And, if they did, they would soon find out that the result would be incorrect.
There was a problem hiding this comment.
Yes, I guess it should have been "or anything that can initialize a Longitude" - the fact that float is also allowed is extra (because we give a default unit of u.deg in the initializer). The question is whether it is worth doing a quick follow-up PR that deprecates that behaviour (and perhaps clarifies the docstring).
There was a problem hiding this comment.
I'll leave that entirely up to you. Obviously, sidereal_time() has been around for awhile, so any confusion will only affect new users and people who have been using it for years may not appreciate depreciation warnings, but if you feel strongly that a unit should be specified, then go ahead and require one.
There was a problem hiding this comment.
@mkbrewer I didn't habe a look at this earlier because I only noticed this PR because the corresponding issue Was closed by merging it ;)
There was a problem hiding this comment.
And I am very happy to have it closed after being open for over a year!
Description
This pull request is to address my request in issue #10239 for the Local Earth Rotation Angle (
eral). It also corrects the local sidereal time for the TIO in models that include it. My preference would be to also change the meaning ofgreenwichto be the angle at the TIO (i.e. GMST, GAST, or ERA), but I don't think @mhvk would go along with that.Fixes #10239