Skip to content

Attempt to calculate delta_ut1_utc when the attribute is accessed directly - #1925

Merged
taldcroft merged 3 commits into
astropy:masterfrom
mhvk:time-delta-ut1-utc
Jan 4, 2014
Merged

taldcroft merged 3 commits into
astropy:masterfrom
mhvk:time-delta-ut1-utc

Conversation

@mhvk

@mhvk mhvk commented Dec 22, 2013

Copy link
Copy Markdown
Contributor

A partial answer to the bugs reported in #1924. Now:

from astropy.time import Time
t = Time('2010-02-03 12:13:14', scale='utc')
t.delta_ut1_utc

yields

array([ 0.08327665])

instead of giving a rather obscure error message

Comment thread astropy/time/core.py Outdated

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 somehow breaks the symmetry in a weird way. What about leaving both the defaults at None and then doing:

if jd1 is None and jd2 is None:
    utc = self.utc
    jd1 = utc.jd1
    jd2 = utc.jd2
else:
    if jd1 is None:
        jd1 = 0.0
    if jd2 is None:
        jd2 = 0.0

@taldcroft

Copy link
Copy Markdown
Member

@mhvk - looks good. I marked this as 0.3.1 and we can call it a bug fix. Can you update CHANGES.rst accordingly?

@mhvk

mhvk commented Dec 28, 2013

Copy link
Copy Markdown
Contributor Author

@taldcroft - OK, CHANGES.rst updated

taldcroft added a commit that referenced this pull request Jan 4, 2014
Attempt to calculate delta_ut1_utc when the attribute is accessed directly
@taldcroft
taldcroft merged commit 41ee2b4 into astropy:master Jan 4, 2014
@mhvk
mhvk deleted the time-delta-ut1-utc branch January 5, 2014 06:16
@embray

embray commented Jan 6, 2014

Copy link
Copy Markdown
Member

This was added to the 0.4 section of the changelog but is in the 0.3.1 milestone. I'm not sure which was the intent.

taldcroft added a commit that referenced this pull request Feb 12, 2014
Attempt to calculate delta_ut1_utc when the attribute is accessed directly
Conflicts:

	CHANGES.rst
taldcroft added a commit that referenced this pull request Feb 12, 2014
Attempt to calculate delta_ut1_utc when the attribute is accessed directly
Conflicts:

	CHANGES.rst
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.

3 participants