Skip to content

Commit e172c7a

Browse files
committed
made satellite names clickable
1 parent d5f8f03 commit e172c7a

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

RMS/Routines/SatellitePositions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ def getSatelliteTracks(self, platepar, fov_polygon, satellites, time_step_second
507507

508508
visible_tracks.append({
509509
"name": sat.name,
510+
"norad_id": sat.model.satnum,
510511
"time": time_clipped,
511512
"x": x_clipped,
512513
"y": y_clipped,

Utils/SkyFit2.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15568,7 +15568,19 @@ def drawSatelliteTracks(self):
1556815568
label_x = x[best_idx]
1556915569
label_y = y[best_idx]
1557015570

15571-
text = pg.TextItem(track['name'], color=color, anchor=(0, 1))
15571+
# Build clickable HTML label linking to n2yo.com (same pattern as star name hyperlinks)
15572+
norad_id = track.get('norad_id', None)
15573+
r, g, b = color
15574+
hex_color = f"#{r:02x}{g:02x}{b:02x}"
15575+
if norad_id:
15576+
html_text = (
15577+
f'<a href="https://www.n2yo.com/satellite/?s={norad_id}" '
15578+
f'style="color: {hex_color}; text-decoration: none;">'
15579+
f'{track["name"]}</a>'
15580+
)
15581+
else:
15582+
html_text = f'<span style="color: {hex_color};">{track["name"]}</span>'
15583+
text = TextItem(html=html_text, anchor=(0, 1))
1557215584

1557315585
# Increase text size by 50% and make it bold
1557415586
font = QFont()

0 commit comments

Comments
 (0)