Skip to content

Commit

Permalink
Update OrbitAuxReader.py
Browse files Browse the repository at this point in the history
Only one check now for when e>=1 instead of two separate checks for e=1 and w>1
  • Loading branch information
Little-Ryugu committed Dec 18, 2024
1 parent 06f227c commit c5d58e5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/sorcha/readers/OrbitAuxReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,18 @@ def _process_and_validate_input_table(self, input_table, **kwargs):
)
error_raised = False
# checks all objects before a system exit
filtered_df = input_table.loc[(input_table["e"] == 1), ["ObjID"]]
filtered_df = input_table.loc[(input_table["e"] >= 1), ["ObjID"]]
if not filtered_df.empty:
error_raised = True
pplogger.error(
f"ERROR: For Object(s) {', '.join(filtered_df['ObjID'].astype(str))}. Parabolic orbit (e == 1) is undefined in Keplerian elements."
f"ERROR: For Object(s) {', '.join(filtered_df['ObjID'].astype(str))}. Parabolic orbit (e == 1) and Hyperbolic orbit (e > 1) are not supported for Keplerian elements."
)
filtered_df = input_table.loc[(input_table["e"] < 0), ["ObjID"]]
if not filtered_df.empty:
error_raised = True
pplogger.error(
f"ERROR: For Object(s) {', '.join(filtered_df['ObjID'].astype(str))}. Eccentricity (e) cannot be less than 0."
)
filtered_df = input_table.loc[(input_table["e"] > 1), ["ObjID"]]
if not filtered_df.empty:
error_raised = True
pplogger.error(
f"ERROR: For Object(s) {', '.join(filtered_df['ObjID'].astype(str))}. Hyperbolic orbit (e > 1) is not supported for Keplerian elements."
)
filtered_df = input_table.loc[(input_table["e"] < 1) & (input_table["a"] < 0), ["ObjID"]]
if not filtered_df.empty:
error_raised = True
Expand Down

0 comments on commit c5d58e5

Please sign in to comment.