Skip to content

Commit 1426f8a

Browse files
committed
(step-detect) chore: notes for auto-mode && add dependencies
1 parent 6bf3ea1 commit 1426f8a

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ requests==2.31.0
1313
jenkspy==0.4.0
1414
pyecharts==2.0.4
1515
global_land_mask==1.0.0
16-
ephem==4.2
16+
ephem==4.2
17+
ruptures==1.1.10

src/constellation_generation/by_TLE/satellite_to_orbit_mapping.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def histogram_detection():
8282
# Find peaks
8383
peaks, _ = find_peaks(
8484
smoothed,
85-
height=np.max(smoothed) * 0.05, # 5% of max height
85+
height=np.max(smoothed) * 0.05,
8686
distance=max(1, len(smoothed) // 50),
8787
)
8888

@@ -100,7 +100,7 @@ def gap_analysis():
100100
# Find gaps that are outliers using z-score
101101
if len(gaps) > 0:
102102
z_scores = np.abs((gaps - np.mean(gaps)) / np.std(gaps))
103-
significant_gaps = np.sum(z_scores > 2.0) # 2 standard deviations
103+
significant_gaps = np.sum(z_scores > 2.0)
104104
return max(1, significant_gaps + 1)
105105

106106
return 1
@@ -131,14 +131,13 @@ def jenks_optimization():
131131
breaks = jenkspy.jenks_breaks(raans, n_classes=k)
132132
gvf = jenkspy.goodness_of_variance_fit(raans, breaks)
133133

134-
# Look for elbow point
135134
if k == 1:
136135
best_gvf = gvf
137136
best_k = k
138-
elif gvf - best_gvf > 0.03: # Significant improvement
137+
elif gvf - best_gvf > 0.03:
139138
best_gvf = gvf
140139
best_k = k
141-
elif gvf > 0.85 and (gvf - best_gvf) < 0.01: # Diminishing returns
140+
elif gvf > 0.85 and (gvf - best_gvf) < 0.01:
142141
break
143142
except Exception:
144143
continue
@@ -215,8 +214,11 @@ def satellite_to_orbit_mapping(shells: list, auto_gen: bool = True) -> None:
215214

216215
orbits_number = 0
217216

217+
# NOTE: Automatic Mode is recommended for most scenarios especially when dealing with large datasets.
218+
# Automatic Mode gains more effectiveness but may sacrifice some accuracy.
219+
# Manual Mode offers precision but is more time-consuming.
218220
if not auto_gen:
219-
# Observation Mode: visualize RAAN distribution and manually input orbit number
221+
# Manual Mode: visualize RAAN distribution and manually input orbit number
220222
plt.plot(raans)
221223
plt.ylabel("RAANS")
222224
plt.show()

0 commit comments

Comments
 (0)