Skip to content

Commit 55cea03

Browse files
Edward Molterbsipocz
authored andcommitted
changes suggested by @bsipocz, most importantly adding platform-independent newline handling
1 parent 9570932 commit 55cea03

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

astroquery/solarsystem/pds/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ def ephemeris_async(self, planet, *, epoch=None, location=None, neptune_arcmodel
186186
)
187187

188188
# configure request_payload for ephemeris query
189-
190189
request_payload = dict(
191190
[
192191
("abbrev", planet[:3]),
@@ -389,13 +388,13 @@ def _parse_result(self, response, verbose=None):
389388

390389
# Neptune ring arcs data
391390
elif group.startswith("Courage"):
392-
lines = group.split(os.linesep)[:5] #requires explicit split by os.linesep because windows and macos handle this text block differently
391+
lines = group.splitlines()
393392
for i in range(len(lines)):
394393
l = lines[i].split(":")
395394
ring = l[0].split("longitude")[0].strip()
396395
[min_angle, max_angle] = [
397-
float(s)
398-
for s in re.sub("[a-zA-Z]+", "", l[1]).split()
396+
float(s.strip())
397+
for s in re.sub("[a-zA-Z]+", "", l[1]).strip("()").split()
399398
]
400399
if i == 0:
401400
ringtable_names = ("ring", "min_angle", "max_angle")

docs/solarsystem/pds/pds.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ Outputs
6363
---------
6464
``bodytable`` is a `~astropy.table.QTable` containing ephemeris information on the moons in the planetary system. Every column is assigned a unit from `~astropy.units`. We can get a list of all the columns in this table with:
6565

66+
6667
.. doctest-remote-data::
6768

6869
>>> print(bodytable.columns)
6970
<TableColumns names=('NAIF ID','Body','RA','Dec','RA (deg)','Dec (deg)','dRA','dDec','sub_obs_lon','sub_obs_lat','sub_sun_lon','sub_sun_lat','phase','distance')>
7071

7172
``ringtable`` is a `~astropy.table.QTable` containing ephemeris information on the individual rings in the planetary system. Every column is assigned a unit from `~astropy.units`. We can get a list of all the columns in this table with:
7273

74+
7375
.. doctest-remote-data::
7476

7577
>>> print(ringtable.columns)
@@ -93,7 +95,6 @@ Note that the behavior of ``ringtable`` changes depending on the planet you quer
9395

9496
System-wide data are available as metadata in both ``bodytable`` and ``ringtable`` (if ``ringtable`` exists), e.g.:
9597

96-
9798
.. doctest-remote-data::
9899

99100
>>> systemtable = bodytable.meta
@@ -106,5 +107,3 @@ Reference/API
106107

107108
.. automodapi:: astroquery.solarsystem.pds
108109
:no-inheritance-diagram:
109-
110-
.. _NASA Planetary Data System's Ring Node System: https://pds-rings.seti.org/

0 commit comments

Comments
 (0)