Skip to content

Commit 012875c

Browse files
committed
Issue #136: Tighten bounds on opportunity checking
1 parent 2d15e29 commit 012875c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/bsk_rl/envs/general_satellite_tasking/scenario/satellites.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ def __init__(
296296
*args,
297297
generation_duration: float = 600.0,
298298
initial_generation_duration: Optional[float] = None,
299-
access_dist_threshold: float = 4e6,
300299
**kwargs,
301300
) -> None:
302301
"""Construct an AccessSatellite.
@@ -307,15 +306,12 @@ def __init__(
307306
`time_limit` unless the simulation is infinite. [s]
308307
initial_generation_duration: Duration to initially calculate imaging windows
309308
[s]
310-
access_dist_threshold: Distance bound [m] for evaluating imaging windows
311-
more exactly. 4e6 will capture >10 elevation windows for a 500 km orbit.
312309
args: Passed through to Satellite constructor
313310
kwargs: Passed through to Satellite constructor
314311
"""
315312
super().__init__(*args, **kwargs)
316313
self.generation_duration = generation_duration
317314
self.initial_generation_duration = initial_generation_duration
318-
self.access_dist_threshold = access_dist_threshold
319315

320316
def reset_pre_sim(self) -> None:
321317
"""Reset satellite window calculations and lists."""
@@ -388,9 +384,15 @@ def calculate_additional_windows(self, duration: float) -> None:
388384
times = r_BP_P_interp.x[window_calc_span]
389385
positions = r_BP_P_interp.y[window_calc_span]
390386

387+
r_max = np.max(np.linalg.norm(positions, axis=-1))
388+
access_dist_thresh_multiplier = 1.1
391389
for location in self.locations_for_access_checking:
390+
alt_est = r_max - np.linalg.norm(location["location"])
391+
access_dist_threshold = (
392+
access_dist_thresh_multiplier * alt_est / np.sin(location["min_elev"])
393+
)
392394
candidate_windows = self._find_candidate_windows(
393-
location["location"], times, positions, self.access_dist_threshold
395+
location["location"], times, positions, access_dist_threshold
394396
)
395397

396398
for candidate_window in candidate_windows:

0 commit comments

Comments
 (0)