Catch missing M1 and catch missing phase coefficient separately
@@ -129,7 +129,6 @@ class HorizonsClass(BaseQuery):
closest_apparition=False, no_fragments=False,
get_query_payload=False,
get_raw_response=False, cache=True):
-
"""
Query JPL Horizons for ephemerides. The ``location`` parameter
in ``HorizonsClass`` refers in this case to the location of
@@ -380,7 +379,6 @@ class HorizonsClass(BaseQuery):
def elements_async(self, get_query_payload=False,
closest_apparition=False, no_fragments=False,
get_raw_response=False, cache=True):
-
"""
Query JPL Horizons for osculating orbital elements. The ``location``
parameter in ``HorizonsClass`` refers in this case to the center
@@ -557,7 +555,6 @@ class HorizonsClass(BaseQuery):
def vectors_async(self, get_query_payload=False,
closest_apparition=False, no_fragments=False,
get_raw_response=False, cache=True):
-
"""
Query JPL Horizons for state vectors. The ``location``
parameter in ``HorizonsClass`` refers in this case to the center
@@ -811,15 +808,21 @@ class HorizonsClass(BaseQuery):
# read in M1, M2, k1, k2, and phcof (if available)
if "Comet physical" in line:
HGline = src[idx + 2].split('=')
+ try:
M1 = float(HGline[1].rstrip('M2'))
k1 = float(HGline[3].rstrip('k2'))
+ except ValueError as e:
+ M1 = nan
+ k1 = nan
try:
M2 = float(HGline[2].rstrip('k1'))
k2 = float(HGline[4].rstrip('PHCOF'))
- phcof = float(HGline[5])
except ValueError:
M2 = nan
k2 = nan
+ try:
+ phcof = float(HGline[5])
+ except ValueError as e:
phcof = nan
# catch unambiguous names
if (("Multiple major-bodies match string" in line or
