Skip to content

Commit

Permalink
fix calculation of only one gst link
Browse files Browse the repository at this point in the history
  • Loading branch information
pfandzelter committed Jun 18, 2024
1 parent c69c5c2 commit 1afc615
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions celestial/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,9 @@ def _numba_update_plus_grid_links(
link_array[isl_idx]["distance_m"] = np.uint32(d)

gst_link_id = 0
MAX_INT32 = 2**31 - 1
for gst in gst_array:
shortest_d = np.uint32(np.inf)
shortest_d = MAX_INT32

for sat_idx in range(total_sats):
# calculate distance
Expand All @@ -739,11 +740,12 @@ def _numba_update_plus_grid_links(
gst["conn_type"]
== celestial.config.GroundStationConnectionType.ONE.value
):
# print(shortest_d, d)
if d > shortest_d:
continue

# but can't overwrite if we're haven't written anything yet
if shortest_d != np.uint32(np.inf):
# but can't overwrite if we haven't written anything yet
if shortest_d != MAX_INT32:
gst_link_id -= 1

shortest_d = d

Check failure on line 751 in celestial/shell.py

View workflow job for this annotation

GitHub Actions / python

Incompatible types in assignment (expression has type "unsignedinteger[_32Bit]", variable has type "int") [assignment]
Expand Down

0 comments on commit 1afc615

Please sign in to comment.