Skip to content

Change time scale of J2000 to TT - #8594

Merged
eteq merged 5 commits into
astropy:masterfrom
eteq:j2000-to-tt
May 3, 2019
Merged

eteq merged 5 commits into
astropy:masterfrom
eteq:j2000-to-tt

Conversation

@eteq

@eteq eteq commented Apr 18, 2019

Copy link
Copy Markdown
Member

While reviewing #8394 I noticed that we have been using Jan 1, 2000 12:00 UTC as "J2000". It's not clear to me that this is the right thing to do. Rather I think it's supposed to be Jan 1, 2000 12:00 TT. This PR updates the default settings so that TT is used be default.

While it would be nice to have a deprecation period, it's not really clear to me that there's any way to do that without massive disruption, so this seems a safer bet than waiting until 4.0...

Two questions, though:

  1. I don't actually know how to determine the "true" J2000 definition. The best I found to state it clearly is here: https://en.wikipedia.org/wiki/Epoch_(astronomy)#Julian_years_and_J2000 , but (citation needed), as "by international agreement" seems a bit sketchy to me! There's also this on the IAU web site: https://www.iau.org/public/themes/place_in_cosmos/, but does anyone know an authoritative source?
  2. Right now this creates an inconsistency between the default and if you use the string equinox='J200' because the latter is UTC. This is a bit non-trivial to change because it's violating the basic rule that "whatever you give as the equinox attribute gets passed through to Time". E.g. Time('J2000') yields the UTC, not the TT version (which is a defensible stance). I think I'm OK with that because honestly if you're using the string the TT vs UTC difference is probably not that big a deal. But we could add some logic to specifically set the scale to TT if the input value starts with 'J' if consistency is more important...

cc @adrn @mhvk @Juanlu001 @StuartLittlefair

@eteq eteq added this to the v3.2 milestone Apr 18, 2019
@eteq eteq mentioned this pull request Apr 18, 2019
@mhvk

mhvk commented Apr 19, 2019

Copy link
Copy Markdown
Contributor

I think you are correct. It then begs the question is the julian strings in Time should not just have TT as the default time scale (@taldcroft?)....

@astrojuanlu

Copy link
Copy Markdown
Member

I don't actually know how to determine the "true" J2000 definition.

I've had this struggle in poliastro as well. USNO Circular 179 uses TT, but the JPL ephemerides (HORIZONS, SPICE) use TDB:

poliastro/poliastro@35431a6

In any case, either of those is better than UTC. I use J2000 as reference epoch a lot, and when you add large timedeltas to it you start getting warnings about future leap seconds, which doesn't happen in the other timescales.

Right now this creates an inconsistency between...

I agree with @mhvk here, that J* strings should use TT by default.

@eteq

eteq commented Apr 19, 2019

Copy link
Copy Markdown
Member Author

Alright, I've updated this to do as you both suggested, @mhvk and @Juanlu001 and now J-strings (and J epochs that are floats) in Time also go to 'tt'.

This still leaves the question of whether we want a deprecation period. I'm willing to make a command decision there if the three of us agree in coordinates, but since this now also affects time, I'm less certain. Are you willing to make this call, @mhvk, or do you think it has to wait on @taldcroft (who I think can't look until after tonight's feature freeze).

An alternative is to save the Time changes for 4.0 and instead just change TimeAttribute in this PR... That feels like stretching out a confusion, but it is a possible middle ground...

@mhvk

mhvk commented Apr 19, 2019

Copy link
Copy Markdown
Contributor

@eteq - I think we're duplicating each other... See #8600

@eteq

eteq commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

As I suggested in #8600 (comment) I've rolled this back to not include Time modifications, as @mhvk's #8600 fit is a better direction. The idea would be to merge this to make sure we get the coordinates parts in, but #8600 would do the Time changes (which might involve partly backing out the final commit in this PR).

Since we ruled this a bug in #8600 it's backportable (although it definitely should come before #8600 for the backport to be sensible)

@astrojuanlu

Copy link
Copy Markdown
Member

The errors seem unrelated: <SAMPProxyError 1: 'Timeout expired!'> and docstring of astropy.cosmology.FLRW.Odm:27:Unexpected section title or transition.

@pllim

pllim commented Apr 25, 2019

Copy link
Copy Markdown
Member

Looks like @eteq and @mhvk have competing PRs? I'll let them figure it out first...

@eteq

eteq commented Apr 26, 2019 •

Copy link
Copy Markdown
Member Author

@pllim - you mean #8600, right? In #8600 (comment) (and #8594 (comment)) I proposed we merge this as the coordinates changes (as I think in #8600 (comment) @mhvk agreed that at least part of this approach was better for coordinates), and then #8600 can be rebased on top of this to focus more on the time changes (for which @mhvk's solution was definitely superior) and perhaps some of the tests (to make them all more consistent).

And re: the test failures, I agree wit @Juanlu001 they are probably red herrings - it looks like the doc failure was unrelated (fixed in #8626) an the other one is a timeout so re-started the build just to be sure

@pllim

pllim commented Apr 26, 2019

Copy link
Copy Markdown
Member

Thanks for the clarification, @eteq . In that case, I propose that @mhvk should press the approve button.

@eteq

eteq commented May 1, 2019 •

Copy link
Copy Markdown
Member Author

(note: the one CI error is a red herring as it's a doc problem in cosmology and unrelated)

@taldcroft taldcroft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I just added a whats-new-needed tag since I think there should be some high-level visibility above the change log.

I note that there will be a number of conflicts with #8600 since that goes the route of removing the explicit scale='utc' instead of replacing it with scale='tt'. I would have done it like in #8600 (remove and rely on default), but either way is OK.

@codecov

codecov Bot commented May 2, 2019

Copy link
Copy Markdown

Codecov Report

Merging #8594 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8594      +/-   ##
==========================================
+ Coverage   86.93%   86.94%   +<.01%     
==========================================
  Files         399      400       +1     
  Lines       59249    59329      +80     
  Branches     1100     1100              
==========================================
+ Hits        51511    51586      +75     
- Misses       7097     7102       +5     
  Partials      641      641
Impacted Files Coverage Δ
astropy/coordinates/builtin_frames/utils.py 94.11% <100%> (ø) ⬆️
astropy/stats/bls/__init__.py 66.66% <0%> (-11.12%) ⬇️
astropy/timeseries/periodograms/__init__.py 100% <0%> (ø) ⬆️
astropy/timeseries/periodograms/base.py 88% <0%> (ø)
...stropy/timeseries/periodograms/lombscargle/core.py 96.17% <0%> (+0.59%) ⬆️
astropy/timeseries/periodograms/bls/core.py 92.06% <0%> (+1.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d84c4f...50def24. Read the comment docs.

@eteq

eteq commented May 2, 2019

Copy link
Copy Markdown
Member Author

Updated as suggested by @taldcroft . Re:

I note that there will be a number of conflicts with #8600 since that goes the route of removing the explicit scale='utc' instead of replacing it with scale='tt'. I would have done it like in #8600 (remove and rely on default), but either way is OK.

My thinking is that it's better to be explicit here because that way people looking at it in coordinates will see the answer mainfestly instead of having to figure out the implicit meaning. But I think we should also fix it in time a la #8600 so I'm thinking to merge this and then rebase that over this.

@eteq
eteq merged commit 2327318 into astropy:master May 3, 2019
@eteq

eteq commented May 3, 2019

Copy link
Copy Markdown
Member Author

(merged based on #8600 (comment) and approval)

bsipocz pushed a commit that referenced this pull request May 3, 2019
Change time scale of J2000 to TT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants