Commit Graph

41 Commits

Author SHA1 Message Date
Brandon Rhodes 24b0ac3700 For #406, add Time constructors from datetimes
This was previously an implicit power of `ts.utc()` which was more
difficult for users to find.
2020-07-17 09:41:48 -04:00
Brandon Rhodes d2b105d6a0 Extend two-float precision to how UT1 is stored 2020-07-15 06:24:48 -04:00
Brandon Rhodes b254335063 Fix #395 by making Time objects hashable 2020-07-02 12:47:07 -04:00
Brandon Rhodes d1108c547f Improve precisions of calendar TT and TAI times 2020-06-07 15:06:15 -04:00
Brandon Rhodes ecbd5d5cff Add JD fraction to TAI constructor, tdb_minus_tt()
And along the way, start simplifying docstrings that look a bit redundant.
2020-06-07 13:38:29 -04:00
Brandon Rhodes 47c0de9446 Complete a few timelib TODOs related to precision 2020-06-07 11:47:06 -04:00
Brandon Rhodes 2baa5d0b06 Fix #293 by keeping two TT floats inside each Time
More work will be necessary to carry through the extra precision
everywhere, but this is a start that addresses the most visible
manifestation of the previously low precision.
2020-05-10 13:19:47 -04:00
Brandon Rhodes 5f867b9b25 Fix #335 by providing an actual weekday value 2020-02-02 06:32:27 -05:00
Brandon Rhodes 563345fefd Make files happier by removing trailing spaces 2020-01-12 16:36:09 -05:00
Brandon Rhodes c8af2b2859 Document millisecond precision of datetimes
Minimally fix #293 by documenting the behavior that a user found
surprising, and make plans for improving it in the future.
2019-11-07 19:52:39 -05:00
Brandon Rhodes 502dd89963 Include array in Time repr() if array is short
Also, start printing repr() floats at full precision, this that’s the
contract that Python float repr()s make.
2018-09-09 12:32:54 -04:00
Brandon Rhodes 002f2abc32 Separate methods for creating times from JD’s
It was awkward to hide the ability to create times from the Julian day
behind the very last argument in the time constructor argument lists.
Let’s start moving in a better direction that makes the ability more
discoverable, and starts to backtrack on one of those awkward situations
where half the arguments to a given method are always useless.

Fixes #181.
2018-07-08 21:31:50 -04:00
Brandon Rhodes 0e9c01959b Add Julian decimal years ``Time`` attribute ``.J`` 2018-05-20 21:04:36 -04:00
Brandon Rhodes 787d6c1b54 Allow time objects to be constructed from UT1
Fixes #91.
2018-05-20 14:13:06 -04:00
Brandon Rhodes 835123f1d3 Support arrays in all time constructor arguments 2018-03-25 13:56:27 -04:00
Richard Shaw 10d7a89095 Fix for calendar_tuple (#103)
Corrects a typo in the date logic — thank you, @jrs65!
2016-08-27 16:29:13 -04:00
Richard Shaw d2d117855b Tests and fixes for issues in Time (#101)
* Added tests to cover issues (delta_t calculation, and __repr__ output).

* Added a fix to the array Time.__repr__ issue (now gives a similar format to skyfield.units.Angle)

* Added fix for future scalar delta_t issue.
2016-08-07 22:16:45 -04:00
Brandon Rhodes 08ae390b74 Switch all internal names for Time objects to "t" 2016-03-25 10:32:58 -04:00
Brandon Rhodes 9da1bdb16a Update most of the docs to talk about Time objects
Except, predictably, for the ``time.rst`` file, which will probably have
to be rewritten before this new version of Skyfield can be released.
2016-03-23 01:55:18 -04:00
Brandon Rhodes e71e50a00a Rename `JulianDate` to `Time`
This improvement removes the apparent redundancy from a statement like:

    jd = ts.tt(jd=value)

(why are the raw value and the object both named `jd`, a user might
wonder?) and also hopefully makes it less likely that new users will
think that a `JulianDate` object specifies merely a date but not also a
specific time.
2016-03-23 01:07:19 -04:00
Brandon Rhodes 37c56008f0 Make date components real time method arguments
I got tired of seeing so many double parentheses in calls like
`ts.utc((1980, 2, 3))` and so I am pivoting away from tuple arguments
and towards separate date components for the timescale methods, so the
calls read like `ts.utc(1980, 2, 3)` instead.
2016-03-21 00:27:32 -04:00
Brandon Rhodes f61ca301fb Switch to load.timescale() for loading Timescale
It makes more sense to have the `Loader` know everything about how to
download the correct files from the Internet, rather than having the
Timescale know internally how to fetch its data.
2016-03-20 16:57:28 -04:00
Brandon Rhodes 38389cdebb Remove two unused imports of "JulianDate" 2016-03-01 22:23:16 -05:00
Brandon Rhodes a2482e67e9 Remove "tai" parameter from JulianDate init 2016-03-01 21:34:43 -05:00
Brandon Rhodes 953f999097 Remove "utc" parameter from JulianDate init 2016-02-23 20:34:39 -05:00
Brandon Rhodes 2636403d5c Remove "tdb" parameter from JulianDate init 2016-02-23 19:59:44 -05:00
Brandon Rhodes 7148d07adb Remove old takes_julian_date() wrapper 2016-02-23 12:49:54 -05:00
Brandon Rhodes a73cab2005 Automatically generate Delta T if not provided 2015-11-29 18:29:40 -05:00
aarose a6c56247d1 Added test for new tuple error for takes_julian_date decorator 2015-04-13 18:57:16 -04:00
Brandon Rhodes 0faaf3dd12 Remove remaining py.test imports in favor of Assay 2014-11-23 18:25:45 -05:00
Brandon Rhodes bbb7cf90bf Simplify astimezone() and utc_datetime() methods
My initial idea had been that all date-time methods ought to return
leap-second indicators, so that the fact of leap seconds would be
obvious to all users asking for dates, and I would not get as many
questions about apparent discontinuities when users generate close time
series that cross leap-second boundaries.

But on the twenty or thirty different occasions on which I have needed
utc_datetime() so far, I myself have *always* forgotten about the second
return value and have *never* remembered to prepare for it.  So I am
changing these methods to do the obvious thing that users will expect,
and making alternative versions of them for users who care about leap
seconds.
2014-11-20 16:56:12 -05:00
Brandon Rhodes 0bf1c500e8 Switch to Assay-style test fixtures 2014-11-04 19:16:36 -05:00
Brandon Rhodes 71edf8041e Allow JulianDate to be built given an input TDB 2014-02-02 00:18:53 -05:00
Brandon Rhodes 33324021b3 Implement "B.C." in the JPL-style date formatter 2014-01-26 16:37:14 -05:00
Brandon Rhodes a5a0755230 Defer UTC computation to a single unified routine 2014-01-26 16:26:22 -05:00
Brandon Rhodes 7d1a351b85 Fix: JulianDate(tai=...) should allow a tuple 2014-01-26 14:12:42 -05:00
Brandon Rhodes 86dac6a2f0 Fix test: ValueErrors have no .message in Python 3 2014-01-23 19:24:23 -05:00
Brandon Rhodes 1f419175fb Confirm that we can also slice JulianDates 2014-01-23 18:32:09 -05:00
Brandon Rhodes c0a3564a03 Make it possible to index into a JulianDate 2014-01-23 18:30:45 -05:00
Brandon Rhodes ba423ff142 Improve the error message for naive datetimes 2014-01-23 18:21:47 -05:00
Brandon Rhodes 0662716485 Rename the "timescales" module to "timelib" 2014-01-21 00:20:02 -05:00