Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed another edge case when parsing Horizons output for mass
Browse files Browse the repository at this point in the history
  • Loading branch information
MintoDA1 authored and MintoDA1 committed Aug 2, 2023
1 parent 2329bc9 commit 081439d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/swiftest/swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ def get_Gmass(raw_response):
if len(GM) == 0:
return None
GM = GM[0]
GM = GM.split('GM')[1]
GM = GM.split('=')[1]
GM = GM.strip().split(' ')[0].split('+')[0]
if len(GM) > 1:
GM = GM.split('GM')[1]
if len(GM) > 1:
GM = GM.split('=')
if len(GM) > 1:
GM = GM[1].strip().split(' ')[0].split('+')[0]
try:
GM = float(GM)
except:
Expand Down

0 comments on commit 081439d

Please sign in to comment.