Commit Graph

1677 Commits

Author SHA1 Message Date
Brandon Rhodes 72298a4727 Remove four fmod() calls that make no difference 2020-05-24 16:14:08 -04:00
Brandon Rhodes 824a998816 Fix iau2000b broadcasting when time is a float 2020-05-24 16:01:49 -04:00
Brandon Rhodes c10502ae5f Replace duplicated constants in iau2000b() 2020-05-24 15:39:34 -04:00
Brandon Rhodes 4fe491bbfb Add attributes year, month, etc to `t.utc` objects 2020-05-24 15:05:32 -04:00
Brandon Rhodes 609df9a268 Mention “m” argument in Distance docstring 2020-05-24 13:05:25 -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 0b22e0e47b Add Docker container for local test of Python 2.6
It’s getting harder to find CI that can easily run 2.6 (without burning
CPU building it from source), so let’s just do it locally.  Hopefully
I’ll remember to run it before each release.
2020-05-20 11:12:25 -04:00
Brandon Rhodes 52cd9a4bfb For #377, add `position_of_radec()`
This deprecates a poorly designed routine (see the changes to its
docstring for details) and replaces it with a better one.
2020-05-20 10:24:34 -04:00
Brandon Rhodes 660a5ef201 Fix #376 by protecting against zero orbits per day
Otherwise, the user gets `ZeroDivisionError: float division by zero`.
2020-05-14 16:41:25 -04:00
Brandon Rhodes 5a9c1a0f52 Consistently use `epoch='date'` with Apparent
Make low-accuracy results like those mentioned in astropy/astropy#10292
less likely by consistently asking for epoch-of-date coordinates every
time `apparent()` coordinates are generated.  And add exactly such an
example to the docstring of the `radec()` call itself, since that is
where users are likely to look.
2020-05-13 06:39:20 -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 c2c32455a8 Remove and revise several old TODO items 2020-05-10 21:31:30 -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 0a5fcdba81 Switch NOVAS tests to modern timescale methods 2020-05-10 15:40:21 -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 667ff9dc86 Improve abs-max maneuver again, so it doesn’t fail
The previous way it was written was great for displaying the error in
failing cases, but, it turns out, would error out for successful cases
when the test should pass (whoops).
2020-05-08 14:36:25 -04:00
Brandon Rhodes 6753f82fa5 Rewrite test inequalities to be assert-visible 2020-05-08 14:31: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 9c52925305 Ignore temporary images and directories, too 2020-05-08 10:49:44 -04:00
Brandon Rhodes 2f4f5b2625 Fix #370 by correcting typo in API docs 2020-05-01 19:45:36 -04:00
Brandon Rhodes e80d602300 Add length() method to Distance 2020-04-30 14:55:30 -04:00
Brady Burnsides d1ab164d82
Add timescale parameter to Loader.tle_file()
Pull request #366.
2020-04-29 10:07:19 -04:00
Brandon Rhodes 2ea7ad1920 Fix #358 by documenting vector subtraction
And make a few other tweaks and improvements to the positions doc.
2020-04-26 10:59:49 -04:00
Jérôme Deuchnord 48f0de3261
Fix typo in the EphemerisRangeError init (#365) 2020-04-26 06:52:00 -04:00
Brandon Rhodes f626abe963 Add changelog entry for new ephemeris exception 2020-04-25 10:11:48 -04:00
Brandon Rhodes c2181134d7 Add a test for the new out-of-range exception
Also made a few tweaks:

1. Switched to “start” and “end” for the two bounding times, to stay
   consistent with the underlying `jplephem` library; otherwise it will
   take more effort to read code as I switch between them.

2. Added “Ephemeris” to the exception name to make it more specific and
   descriptive.

3. Used the name “mask” for the binary array to match NumPy terminology.

4. Also decided to return the SPK segment, in case the user wants to
   more closely inspect exactly which ephemeris segment their program is
   trying to use (in case it’s the wrong one).
2020-04-25 10:06:35 -04:00
Jérôme Deuchnord 468b868e0c
Throw exception for times out of ephemeris range
PR #356.
2020-04-25 07:19:16 -04:00
Brandon Rhodes 8bc5900d0f Version 1.20: tweak SSL fix for older Pythons too 2020-04-24 09:11:13 -04:00
Erik Tollerud 643151db61
Avoid deprecated urlopen() cafile keyword (#363) 2020-04-24 08:49:42 -04:00
Brandon Rhodes e524e069a5 Add build_latlon_degrees() argument "elevation_m" 2020-04-23 17:44:39 -04:00
Brandon Rhodes 8c34184ee4 Remember where certifi version number came from 2020-04-23 13:46:56 -04:00
Brandon Rhodes 310c871494 Bump version to 1.19 2020-04-23 13:41:22 -04:00
Brandon Rhodes e43367b240 Tweak changelog for 1.19 release 2020-04-23 13:39:39 -04:00
Brandon Rhodes f6d76d3f50 Fix #361 by adding a lunar node almanac routine 2020-04-22 09:20:31 -04:00
Brandon Rhodes 785f374f4b Insist “certifi” be as recent as one Requests uses 2020-04-22 08:47:25 -04:00
Brandon Rhodes 97bd2ad3d6 Try switching to “certifi” SSL certificate package
Though I am loathe to introduce yet another dependency to Skyfield,
issue #317 would seem to require it unless I want to guide users through
updating their system certificates themselves, or want to introduce yet
more options and variations in the download routines.  Alas that it
incurs 308k of disk, which most users will never benefit from since
their system certificates were working fine!  But the simplicity of
giving all users the same experience seems at this point preferable.
And the extra disk space is just 1/200th of the cost of NumPy, right?
2020-04-22 08:35:35 -04:00
Brandon Rhodes 1ab4d3d913 Display `builtin=True` advice for third file, too
Should help users in a situation like #317, where it was the leap
second file that gave someone a problem, rather than the more usual ΔT
culprits.
2020-04-22 08:31:28 -04:00
Brandon Rhodes 041e8c78e1 Improve a bit of verbiage 2020-04-22 08:00:36 -04:00
Brandon Rhodes d80f65730d Update builtin timescale files
And along the way to getting the documentation working again, add a new
subterfuge so tests can call `datetime.now()` and get a stable value.
2020-04-22 07:48:48 -04:00
Brandon Rhodes c3656b4073 Fix plots in documentation
I didn’t know to call `figure()` when starting each one, so they were
overwriting each other depending on which order the docs were rendered.
2020-04-19 14:34:27 -04:00
Brandon Rhodes ea15861539 Add example script for computing twilights 2020-04-19 14:26:03 -04:00
Brandon Rhodes ed69c5c096 Rework .timescale() docstring: add example calls
Users periodically report problems that `builtin=True` would fix, so
let’s make the difference more obvious here too.
2020-04-19 13:39:45 -04:00
Brandon Rhodes 29d9b25159 Remove old obsolete Notebook 2020-04-19 12:39:33 -04:00
Brandon Rhodes fdc034813c Switch `separation_from()` example to be practical
Users had no idea what it meant when they saw raw `ICRF` vectors created
in the examples for `separation_from()`, so let’s pivot to an example
that will be relevant: two normal observed positions.
2020-04-18 21:23:01 -04:00
Brandon Rhodes a1189b3e53 Improve what “values from A to B” means
Why did I think that people would want the maximum and minimum?  Having
just printed this myself, I expected it to be the first and last value,
so I’m pivoting to that meaning instead.
2020-04-18 21:21:50 -04:00
Brandon Rhodes fc634ff31c Clarify types of various Topos attributes 2020-04-10 20:08:43 -04:00