Skip to content

Commit ce0673c

Browse files
committed
formatting changes
1 parent 4481c67 commit ce0673c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

gs/backend/positioning/doppler_shift.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Final
22

3-
from skyfield.api import EarthSatellite, Topos, load, Timescale, Time
3+
from skyfield.api import EarthSatellite, Time, Timescale, Topos
44

55
SPEED_OF_LIGHT_METERS_PER_SECOND: Final[int] = 299_792_458
66
TRANSMISSION_FREQUENCY_HZ: Final[float] = 433_920_000 # Default frequency, UW-Orbital's 433.920 MHz band
@@ -10,6 +10,7 @@
1010
@details Since we're not actually getting TLE or interfacing with HackRF it's not hooked up to anything yet
1111
"""
1212

13+
1314
# Change: made function take in time as a parameter instead
1415
def load_satellite(tle_line1: str, tle_line2: str, timescale: Timescale, name: str = "UW_SAT") -> EarthSatellite:
1516
"""
@@ -22,9 +23,14 @@ def load_satellite(tle_line1: str, tle_line2: str, timescale: Timescale, name: s
2223
"""
2324
return EarthSatellite(tle_line1, tle_line2, name, timescale)
2425

26+
2527
# Change: made function take in time as a parameter
2628
def calculate_relative_velocity(
27-
satellite: EarthSatellite, observer_latitude_deg: float, observer_longitude_deg: float, observer_altitude_m: float, time_current: Time
29+
satellite: EarthSatellite,
30+
observer_latitude_deg: float,
31+
observer_longitude_deg: float,
32+
observer_altitude_m: float,
33+
time_current: Time,
2834
) -> float:
2935
"""
3036
@brief Computes relative velocity between satellite and observer
@@ -81,7 +87,7 @@ def calculate_doppler(
8187
observer_longitude_deg: float,
8288
observer_altitude_m: float,
8389
timescale: Timescale,
84-
time_current: Time
90+
time_current: Time,
8591
) -> float:
8692
"""
8793
@brief High-level function to compute Doppler shift
@@ -95,5 +101,7 @@ def calculate_doppler(
95101
@returns Doppler-shifted frequency in Hz
96102
"""
97103
sat = load_satellite(tle_line1, tle_line2, timescale)
98-
rv = calculate_relative_velocity(sat, observer_latitude_deg, observer_longitude_deg, observer_altitude_m, time_current)
104+
rv = calculate_relative_velocity(
105+
sat, observer_latitude_deg, observer_longitude_deg, observer_altitude_m, time_current
106+
)
99107
return compute_doppler_shift(TRANSMISSION_FREQUENCY_HZ, rv)

0 commit comments

Comments
 (0)