11from typing import Final
22
3- from skyfield .api import EarthSatellite , Topos , load , Timescale , Time
3+ from skyfield .api import EarthSatellite , Time , Timescale , Topos
44
55SPEED_OF_LIGHT_METERS_PER_SECOND : Final [int ] = 299_792_458
66TRANSMISSION_FREQUENCY_HZ : Final [float ] = 433_920_000 # Default frequency, UW-Orbital's 433.920 MHz band
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
1415def 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
2628def 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