Skip to content

Commit d05b0f0

Browse files
committed
Add a command line script for ephemeris generation.
Update documentation. Better column normalization. Remove ability to run module via __main__ to avoid package import warning. Rewrite as a class; add tests. Update docs Restore requested and returned targets in table comments. Merge target identifier and target name The two were already confused: "target name" was in "target identifier", but "targetname" was a separate field. Reformat file Missing self Save some basic metadata in Ephem tables. Mock remote horizons comet test. Improve astroquery mocking, and mock more tests. Codestyle; Require astroquery for test Restore failing C/1995 O1 test. Mark code block with bash in docs. Split a string to decrease line length. Revert "Save some basic metadata in Ephem tables." This reverts commit b6429ab. Remove meta lines again.
1 parent df7f292 commit d05b0f0

11 files changed

+1467
-64
lines changed

CHANGES.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
0.6.0 (unreleased)
2+
==================
3+
4+
New Features
5+
------------
6+
7+
sbpy.data.ephem
8+
^^^^^^^^^^^^^^^
9+
10+
- New command-line script: ``sbpy-ephem``.
11+
12+
113
0.5.0 (2024-08-28)
214
==================
315

docs/sbpy/data/ephem.rst

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,43 @@ Telescope:
309309
The properties computed by pyoorb and listed in the resulting table are defined
310310
in the `pyoorb documentation
311311
<https://github.com/oorb/oorb/tree/master/python>`_. Note that this function
312-
requires pyoorb to be installed, which is not a requirement for `sbpy`.
312+
requires pyoorb to be installed, which is not a requirement for `sbpy`.
313+
314+
315+
Executable scripts
316+
------------------
317+
318+
Ephemerides may be generated from the command line using the ``sbpy-ephem``
319+
script installed during sbpy's installation. The script supports ephemeris
320+
generation from Horizons, the Minor Planet Center, and Miriade.
321+
322+
For example, to display the ephemeris of comet 2P/Encke from the Minor Planet
323+
Center:
324+
325+
.. code:: bash
326+
327+
$ sbpy-ephem mpc 2P
328+
# requested target: 2P
329+
# returned target: 2P
330+
# location: 500
331+
date RA Dec rh delta phase solarelong V Proper motion Direction
332+
deg deg AU AU deg deg mag arcsec / h deg
333+
----------------------- ----------- ----------- ----- ----- ----- ---------- ---- ------------- ---------
334+
2024-08-17 00:00:00.000 21:55:57.10 -15:12:47.0 3.368 2.356 0.9 177.1 21.1 47.72 253.7
335+
2024-08-18 00:00:00.000 21:54:41.20 -15:18:06.0 3.373 2.361 0.7 177.5 21.1 47.54 253.9
336+
2024-08-19 00:00:00.000 21:53:25.60 -15:23:21.0 3.378 2.367 0.8 177.4 21.1 47.32 254.0
337+
2024-08-20 00:00:00.000 21:52:10.30 -15:28:32.0 3.383 2.372 1.0 176.7 21.2 47.07 254.1
338+
2024-08-21 00:00:00.000 21:50:55.30 -15:33:38.0 3.388 2.378 1.3 175.8 21.2 46.79 254.3
339+
2024-08-22 00:00:00.000 21:49:40.70 -15:38:40.0 3.393 2.385 1.6 174.7 21.2 46.47 254.4
340+
2024-08-23 00:00:00.000 21:48:26.50 -15:43:37.0 3.398 2.391 1.9 173.5 21.3 46.13 254.6
341+
2024-08-24 00:00:00.000 21:47:12.90 -15:48:29.0 3.403 2.398 2.3 172.3 21.3 45.75 254.7
342+
2024-08-25 00:00:00.000 21:45:59.80 -15:53:16.0 3.408 2.406 2.6 171.1 21.3 45.34 254.9
343+
2024-08-26 00:00:00.000 21:44:47.30 -15:57:57.0 3.413 2.413 3.0 169.9 21.4 44.9 255.0
344+
2024-08-27 00:00:00.000 21:43:35.40 -16:02:33.0 3.418 2.421 3.3 168.7 21.4 44.44 255.2
345+
2024-08-28 00:00:00.000 21:42:24.30 -16:07:04.0 3.423 2.43 3.7 167.4 21.4 43.94 255.3
346+
2024-08-29 00:00:00.000 21:41:13.90 -16:11:28.0 3.427 2.438 4.0 166.2 21.5 43.41 255.5
347+
2024-08-30 00:00:00.000 21:40:04.30 -16:15:47.0 3.432 2.447 4.4 165.0 21.5 42.86 255.6
348+
...
349+
350+
A limited number of input parameters are supported. Run with the ``--help``
351+
option for more details.

sbpy/data/__init__.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,19 @@ class Conf:
4848
fieldnames_info = [
4949
# General
5050
{
51-
"description": "Target Identifier",
52-
"fieldnames": ["targetname", "id", "Object"],
51+
"description": "Target Name",
52+
"fieldnames": [
53+
"targetname",
54+
"Targetname",
55+
"target",
56+
"Target",
57+
"name",
58+
"Name",
59+
"id",
60+
"ID",
61+
"Object",
62+
"object",
63+
],
5364
"provenance": ["orbit", "ephem", "obs", "phys"],
5465
"dimension": None,
5566
},
@@ -61,13 +72,7 @@ class Conf:
6172
},
6273
{
6374
"description": "Target Number",
64-
"fieldnames": ["number"],
65-
"provenance": ["orbit", "ephem", "obs", "phys"],
66-
"dimension": None,
67-
},
68-
{
69-
"description": "Target Name",
70-
"fieldnames": ["name"],
75+
"fieldnames": ["number", "target number"],
7176
"provenance": ["orbit", "ephem", "obs", "phys"],
7277
"dimension": None,
7378
},

0 commit comments

Comments
 (0)