Skip to content

Commit

Permalink
catch failing get_horizons_coord()
Browse files Browse the repository at this point in the history
  • Loading branch information
jgieseler committed Feb 29, 2024
1 parent 982ad2e commit f9947af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion solarmach/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ def __init__(self, date, body_list, vsw_list=[], reference_long=None, reference_
self.reference_lat = reference_lat
self.coord_sys = coord_sys

pos_E = get_horizons_coord(399, self.date, None) # (lon, lat, radius) in (deg, deg, AU)
try:
pos_E = get_horizons_coord(399, self.date, None) # (lon, lat, radius) in (deg, deg, AU)
except ValueError:
print('')
print('!!! No ephemeris found for Earth for date {self.date} - there probably is a problem with JPL HORIZONS.')
if coord_sys=='Carrington':
self.pos_E = pos_E.transform_to(frames.HeliographicCarrington(observer='Sun'))
elif coord_sys=='Stonyhurst':
Expand Down

0 comments on commit f9947af

Please sign in to comment.