Skip to content

Commit a33753b

Browse files
Edward Molterbsipocz
authored andcommitted
added support for jwst
1 parent 550bd95 commit a33753b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

astroquery/solarsystem/pds/core.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ def ephemeris_async(self, planet, *, epoch=None, location=None, neptune_arcmodel
9696
epoch : `~astropy.time.Time` object, or str in format YYYY-MM-DD hh:mm, optional.
9797
If str is provided then UTC is assumed.
9898
If no epoch is provided, the current time is used.
99-
location : array-like, or `~astropy.coordinates.EarthLocation`, optional
100-
Observer's location as a
101-
3-element array of Earth longitude, latitude, altitude, or
99+
location : str, or array-like, or `~astropy.coordinates.EarthLocation`, optional
100+
If str, named observeratory supported by the ring node, e.g. JWST.
101+
If array-like, observer's location as a
102+
3-element array of Earth longitude, latitude, altitude
103+
that istantiates an
102104
`~astropy.coordinates.EarthLocation`. Longitude and
103105
latitude should be anything that initializes an
104106
`~astropy.coordinates.Angle` object, and altitude should
105107
initialize an `~astropy.units.Quantity` object (with units
106-
of length). If ``None``, then the geocenter is used.
108+
of length). If ``None``, then the geofocus is used.
107109
neptune_arcmodel : float, optional. which ephemeris to assume for Neptune's ring arcs
108110
must be one of 1, 2, or 3 (see https://pds-rings.seti.org/tools/viewer3_nep.shtml for details)
109111
has no effect if planet != 'Neptune'
@@ -158,9 +160,15 @@ def ephemeris_async(self, planet, *, epoch=None, location=None, neptune_arcmodel
158160

159161
if location is None:
160162
viewpoint = "observatory"
163+
observatory = "Earth's center"
164+
latitude, longitude, altitude = "", "", ""
165+
elif isinstance(location, str):
166+
viewpoint = "observatory"
167+
observatory = location
161168
latitude, longitude, altitude = "", "", ""
162169
else:
163170
viewpoint = "latlon"
171+
observatory = "Earth's center"
164172
if isinstance(location, EarthLocation):
165173
loc = location.geodetic
166174
longitude = loc[0].deg
@@ -194,7 +202,7 @@ def ephemeris_async(self, planet, *, epoch=None, location=None, neptune_arcmodel
194202
("center_dec", ""),
195203
("center_star", ""),
196204
("viewpoint", viewpoint),
197-
("observatory", "Earth's center"), # has no effect if viewpoint != observatory so can hardcode. no plans to implement calling observatories by name since ring node only names like 8 observatories
205+
("observatory", observatory), # has no effect if viewpoint != observatory so can hardcode. no plans to implement calling observatories by name since ring node only names like 8 observatories
198206
("latitude", latitude),
199207
("longitude", longitude),
200208
("lon_dir", "east"),
@@ -255,6 +263,10 @@ def _parse_result(self, response, verbose=None):
255263

256264
soup = BeautifulSoup(response.text, "html.parser")
257265
text = soup.get_text()
266+
if "\n" in text:
267+
text = text.replace("\r", "")
268+
else:
269+
text = text.replace("\r", "\n")
258270
textgroups = re.split("\n\n|\n \n", text)
259271
ringtable = None
260272
for group in textgroups:

0 commit comments

Comments
 (0)