Skip to content

Commit

Permalink
Issue #136: Tighten bounds on opportunity checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark2000 committed May 16, 2024
1 parent 2d15e29 commit 012875c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/bsk_rl/envs/general_satellite_tasking/scenario/satellites.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ def __init__(
*args,
generation_duration: float = 600.0,
initial_generation_duration: Optional[float] = None,
access_dist_threshold: float = 4e6,
**kwargs,
) -> None:
"""Construct an AccessSatellite.
Expand All @@ -307,15 +306,12 @@ def __init__(
`time_limit` unless the simulation is infinite. [s]
initial_generation_duration: Duration to initially calculate imaging windows
[s]
access_dist_threshold: Distance bound [m] for evaluating imaging windows
more exactly. 4e6 will capture >10 elevation windows for a 500 km orbit.
args: Passed through to Satellite constructor
kwargs: Passed through to Satellite constructor
"""
super().__init__(*args, **kwargs)
self.generation_duration = generation_duration
self.initial_generation_duration = initial_generation_duration
self.access_dist_threshold = access_dist_threshold

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

r_max = np.max(np.linalg.norm(positions, axis=-1))
access_dist_thresh_multiplier = 1.1
for location in self.locations_for_access_checking:
alt_est = r_max - np.linalg.norm(location["location"])
access_dist_threshold = (
access_dist_thresh_multiplier * alt_est / np.sin(location["min_elev"])
)
candidate_windows = self._find_candidate_windows(
location["location"], times, positions, self.access_dist_threshold
location["location"], times, positions, access_dist_threshold
)

for candidate_window in candidate_windows:
Expand Down

0 comments on commit 012875c

Please sign in to comment.