Commit Graph

149 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 d23ce4e1ee For #406, mention more modern timezone sources 2020-07-17 08:18:50 -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 7e2fc1919f Make matrix, vector multiply functions public 2020-06-12 14:18:08 -04:00
Brandon Rhodes e62b0ca093 Update CHANGELOG and declare version 1.22 2020-06-08 10:46:59 -04:00
Brandon Rhodes eda5feac32 Hide Time._nutation_angles_radians for now
I have still not settled on the API for offering alternative nutation
routines, so hiding this gives me the freedom to release later today
without making a public API commitment yet.
2020-06-07 17:09:13 -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 cf836d095c Move divmod responsibility from Time to Timescale 2020-06-07 13:10:03 -04:00
Brandon Rhodes a6fa806131 Now that pyflakes runs in CI, fix its complaints 2020-06-07 12:57:47 -04:00
Brandon Rhodes 352f0c6122 Better approach for keeping TDB fraction precision 2020-06-07 12:12:51 -04:00
Brandon Rhodes 4f1bd9a64d Fix how time equality calls time subtraction 2020-06-07 11:55:34 -04:00
Brandon Rhodes 47c0de9446 Complete a few timelib TODOs related to precision 2020-06-07 11:47:06 -04:00
Brandon Rhodes ccdfdba649 Bring Time attribute documentation up to date
Also, add methods by which users can ask for the nutation and precession
matrices in case they are doing low-level operations.
2020-06-07 11:12:12 -04:00
Brandon Rhodes b3cfd26d0d Stop caching the t.P and t.N matrices
These 3×3 matrices consume 72 bytes of memory for each element in a time
vector, yet are never used by Skyfield once it has built the matrix M.
2020-06-07 06:25:43 -04:00
Brandon Rhodes 57f5ba6a1b Move nutation angle attributes to correct section 2020-06-06 12:17:45 -04:00
Brandon Rhodes 82b6eefe4c Remove old wonky _earth_tilt attribute 2020-06-06 12:12:30 -04:00
Brandon Rhodes 6be8e0937e Switch how users select IAU 2000B nutation angles
But also provide support for the old pattern.
2020-06-06 12:03:08 -04:00
Brandon Rhodes 21175f3ad9 Another round of simplification thanks to radians 2020-06-06 11:06:26 -04:00
Brandon Rhodes b892bc007a Switch new build_nutation_matrix() to radian args
This eliminates conversions in both the caller and the function itself.
2020-06-06 10:45:44 -04:00
Brandon Rhodes 20f0af7b36 Switch to caching nutation angles as radians 2020-06-06 10:43:17 -04:00
Brandon Rhodes 82a60a95e1 Cache mean obliquity in radians, not arcseconds
This is the first step towards caching all nutation-related angles in
radians, to minimize the amount of post-processing necessary when they
are used.
2020-06-06 10:38:50 -04:00
Brandon Rhodes 7d2aa41341 Try new t.nutation_angles_arcseconds angle pair 2020-06-05 22:16:57 -04:00
Brandon Rhodes 240789d1cc Break compute_nutation() free of _earth_tilt 2020-06-05 21:54:50 -04:00
Brandon Rhodes d89ab7d22b Break ecliptic_xyz() free of _earth_tilt 2020-06-05 21:25:51 -04:00
Brandon Rhodes 9eecf711ef Bypass _earth_tilt for computing t.gast 2020-06-05 21:12:26 -04:00
Brandon Rhodes f77fc0beaa Push improved time precision into .observe()
Now that we represent time internally as two floats instead of one, our
light-time correction routine can be improved to generate far less noise
down below the micro-arcsecond level.  That might not sound like much,
but — for example — over the ten seconds around the maximum elongation
of Venus, the elongation varies by only about 5e-5 mas!  Jitter down in
the tens of nano-arcseconds is enough to make a solver think it’s found
several different seconds in which a maximum elongation occurred.
2020-06-04 15:27:31 -04:00
Brandon Rhodes 2d1e8b3761 Use builtin=True more consistently for timescales
It looks like http://maia.usno.navy.mil/ is down this morning, which
reminds me that documentation should be more consistent in loading
timescales from internal files unless illustrating explicitly how to
download up-to-date files.
2020-06-04 05:59:32 -04:00
Brandon Rhodes 4fe491bbfb Add attributes year, month, etc to `t.utc` objects 2020-05-24 15:05:32 -04:00
Brandon Rhodes 0bab9296c7 Further whitespace normalization 2020-05-22 07:59:41 -04:00
Brandon Rhodes ebb4901110 Try rescuing CI with a more stabilized repr()
Apparently the versions of NumPy on Travis CI have different ideas
about whether to put a space after the opening bracket.
2020-05-22 07:56:07 -04:00
Brandon Rhodes 1f8e66a42f Switch to keeping only one whole number in a Time
Instead of splitting every time scale into two floats, let’s keep only a
single master `whole` number and then a series of fractions, each that
when combined with the whole gives the time in a particular scale.  This
saves memory, keeps the attribute list smaller, is conceptually simpler,
and avoids the problem I just encountered with wanting a high precision
two-float version of `ut1` — `ut1_1` or `ut11` would look confusing to
others reading the code, and given that the UT1 timescale at least
includes a number, folks reading `tt1` and `tt2` might have thought
those were different timescales instead of simply two parts of a single
number.  So I will be using `whole` and `fraction` consistently in the
code from now on.
2020-05-12 10:09:52 -04:00
Brandon Rhodes aabb29b57a Use two floats for the TDB Julian date as well 2020-05-10 18:45:32 -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 982bc79867 Remove obsolete UTC year experimental method 2020-05-10 12:15:51 -04:00
Brandon Rhodes 688de2e0fd Avoid repeatedly recomputing leap_reverse_dates 2020-05-10 10:03:26 -04:00
Brandon Rhodes ec3c0f3d7f Auto-round to minutes and seconds for strftime()
This eliminates an awkward `+=` maneuver that was preventing me from
improving the internal representation of time objects.  Hopefully this
is not one of those magic conveniences I come to deeply regret later.
2020-05-10 08:50:57 -04:00
Brandon Rhodes 36e279ada8 Always use _mxm and _mxmxm for matrix multiplies
This gives the code greater consistency, and as a side effect also makes
it easier to search and find all matric multiplies.
2020-05-08 13:43:38 -04:00
Brandon Rhodes f65450d783 Bring Time.utc() back into agreement with docs 2020-02-02 07:48:43 -05:00
Brandon Rhodes 5f867b9b25 Fix #335 by providing an actual weekday value 2020-02-02 06:32:27 -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 348f03caa3 Constellation lookup function, which fixes #228 2019-10-09 15:36:36 -04:00
Brandon Rhodes 911360fb9f Fix Python 2.6 2018-09-23 17:01:39 -04:00
Brandon Rhodes db52f44a3a Like Python datetime, allow another ISO delimiter
ISO date-times are so terrible to try to read using the default 'T'
delimiter.  Offer a way to override it.
2018-09-23 16:48:40 -04:00
Brandon Rhodes 9bcb9d8323 Start explaining “almanac”, and fix a bug 2018-09-11 06:16:51 -04:00
Brandon Rhodes 6c2be20d31 More Almanac tweaks; add phase and phase angle 2018-09-09 21:39:26 -04:00
Brandon Rhodes d2be5672e4 Remove redundant array from IAU2000B 2018-09-09 17:35:42 -04:00
Brandon Rhodes 141d996175 Revert experiment in slicing away nutation terms
It made things a bit faster, but it’s overly arbitrary; it will make
more sense to actually implement IAU2000B for real.
2018-09-09 16:33:45 -04:00
Brandon Rhodes 5d4ae0987e Experiment: what if Time can choose nutation cost? 2018-09-09 16:23:48 -04:00