MCPcopy Index your code
hub / github.com/SpaceNetLab/StarryNet / to_cbf

Method to_cbf

starrynet/sn_observer.py:114–134  ·  view source on GitHub ↗
(self, lat_long,
               length)

Source from the content-addressed store, hash-verified

112 delay_matrix[i, ...] = 0
113
114 def to_cbf(self, lat_long,
115 length): # the xyz coordinate system. length: number of nodes
116 cbf = []
117 radius = 6371
118 for num in range(0, length):
119 cbf_in = []
120 R = radius
121 if len(lat_long[num]) > 2:
122 R += lat_long[num][2]
123 z = R * math.sin(math.radians(float(lat_long[num][0])))
124 x = R * math.cos(math.radians(float(
125 lat_long[num][0]))) * math.cos(
126 math.radians(float(lat_long[num][1])))
127 y = R * math.cos(math.radians(float(
128 lat_long[num][0]))) * math.sin(
129 math.radians(float(lat_long[num][1])))
130 cbf_in.append(x)
131 cbf_in.append(y)
132 cbf_in.append(z)
133 cbf.append(cbf_in)
134 return cbf # xyz coordinates of all the satellites
135
136 def calculate_bound(self, inclination_angle, height):
137 bound_distance = 6371 * math.cos(

Callers 1

calculate_delayMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected