-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample_starlink.py
More file actions
144 lines (112 loc) · 3.21 KB
/
Copy pathexample_starlink.py
File metadata and controls
144 lines (112 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
'''
This example simulates the Starlink constellation with three shells.
It uses the FSPL path loss model and computes the throughput, coverage, and latency/stretch performance metrics.
It also exports the simulation datasets for further analysis.
'''
import time
from LEOCraft.attenuation.fspl import FSPL
from LEOCraft.constellations.LEO_constellation import LEOConstellation
from LEOCraft.dataset import GroundStationAtCities, InternetTrafficAcrossCities
from LEOCraft.performance.basic.coverage import Coverage
from LEOCraft.performance.basic.stretch import Stretch
from LEOCraft.performance.basic.throughput import Throughput
from LEOCraft.satellite_topology.plus_grid_shell import PlusGridShell
from LEOCraft.user_terminals.ground_station import GroundStation
# Exporting all simulation datasets
OUTPUT_PATH = './Starlink'
start_time = time.perf_counter()
# Pathloss model
loss_model = FSPL(
28.5*1000000000, # Frequency in Hz
98.4, # Tx power dBm
0.5*1000000000, # Bandwidth Hz
13.6 # G/T ratio
)
loss_model.set_Tx_antenna_gain(gain_dB=34.5)
leo_con = LEOConstellation('Starlink')
leo_con.v.verbose = True
leo_con.add_ground_stations(
GroundStation(
GroundStationAtCities.TOP_100
# GroundStationAtCities.TOP_1000
# GroundStationAtCities.COUNTRY_CAPITALS
)
)
# Adding Shells
# Starlink Shell 1
leo_con.add_shells(
PlusGridShell(
id=0,
orbits=72,
sat_per_orbit=22,
altitude_m=550000.0,
inclination_degree=53.0,
angle_of_elevation_degree=25.0,
phase_offset=50.0
)
)
# Starlink Shell 2
leo_con.add_shells(
PlusGridShell(
id=1,
orbits=72,
sat_per_orbit=22,
altitude_m=540000.0,
inclination_degree=53.2,
angle_of_elevation_degree=25.0,
phase_offset=50.0
)
)
# Starlink Shell 3
leo_con.add_shells(
PlusGridShell(
id=2,
orbits=36,
sat_per_orbit=20,
altitude_m=570000.0,
inclination_degree=70.0,
angle_of_elevation_degree=25.0,
phase_offset=50.0
)
)
leo_con.set_time() # Time passed after epoch
leo_con.set_loss_model(loss_model)
leo_con.build()
leo_con.create_network_graph()
leo_con.generate_routes()
# Throughput
th = Throughput(
leo_con,
InternetTrafficAcrossCities.ONLY_POP_100
# InternetTrafficAcrossCities.POP_GDP_100
# InternetTrafficAcrossCities.ONLY_POP_1000
# InternetTrafficAcrossCities.COUNTRY_CAPITALS_ONLY_POP
)
th.build()
th.compute()
# Coverage
cov = Coverage(leo_con)
cov.build()
cov.compute()
# Latency/Stretch
sth = Stretch(leo_con)
sth.build()
sth.compute()
end_time = time.perf_counter()
# Constellation
leo_con.export_gsls(OUTPUT_PATH)
leo_con.export_routes(OUTPUT_PATH)
leo_con.export_no_path_found(OUTPUT_PATH)
leo_con.export_k_path_not_found(OUTPUT_PATH)
# Shells
for shell in leo_con.shells:
shell.export_satellites(OUTPUT_PATH)
shell.export_isls(OUTPUT_PATH)
# Ground stations
leo_con.ground_stations.export(OUTPUT_PATH)
# Throughputs
th.export_path_selection(OUTPUT_PATH)
th.export_LP_model(OUTPUT_PATH)
# Stretch
sth.export_stretch_dataset(OUTPUT_PATH)
print(f'Total simulation time: {round((end_time-start_time)/60, 2)}m')