ADCS.CONOPS.goallist.goallist module¶
- class ADCS.CONOPS.goallist.goallist.GoalList(goal_timeline=None, *, time_units='centuries', start_juliantime=None)[source]¶
Bases:
objectTimeline-based container for attitude or mission goals.
This class implements a piecewise-constant goal selection function over mission time, with internal storage in Julian centuries.
Two primary usage modes are supported:
Julian-centuries mode (default) Activation/query times are provided directly in Julian centuries, and stored as-is.
Seconds mode Activation/query times are provided in seconds relative to a specified start epoch in Julian centuries,
start_juliantime. Times are converted internally using\[T = T_0 + t_{\text{sec}} \cdot c_{\text{sec}\to\text{cent}}\]where \(T\) is Julian centuries, \(T_0\) is
start_juliantime, and \(c_{\text{sec}\to\text{cent}}\) issec2cent.
Let a finite ordered set of activation times (in Julian centuries) be
\[\mathcal{T} = \{ T_0, T_1, \dots, T_{N-1} \}, \quad T_0 < T_1 < \dots < T_{N-1}\]with an associated set of goals
\[\mathcal{G} = \{ G_0, G_1, \dots, G_{N-1} \}\]where each \(G_i\) is an instance of
Goal.The active goal as a function of time \(T\) is defined as
\[G(T) = G_k \quad \text{with} \quad k = \max \{ i \mid T_i \le T \}\]If no such index exists, the first goal \(G_0\) is returned. If the timeline is empty, a
No_Goalinstance is returned.Internally, the timeline is represented by two synchronized sorted lists: one containing activation times (Julian centuries) and one containing the corresponding goals. Binary search is used to ensure efficient lookup.
See also
Goal,No_Goal- Parameters:
goal_timeline (Optional[Dict[float, Goal]])
time_units (_TimeUnits)
start_juliantime (Optional[float])
- add_goal(time, goal, *, time_units=None)[source]¶
Insert or update a goal at a given activation time.
The method maintains the strict ordering of activation times in the internal Julian-centuries timeline.
By default, the instance’s
time_unitsis used to interprettime. Alternatively,time_unitsmay be provided per-call to override the interpretation.If
time_units="centuries":timeis interpreted as a Julian-centuries value.If
time_units="seconds":timeis interpreted as seconds relative tostart_juliantimeand is converted internally.
Given an insertion time \(T\) (in Julian centuries), the new goal is placed such that the ordered set
\[T_0 < T_1 < \dots < T < \dots < T_{N}\]is preserved.
If an existing activation time \(T_i\) satisfies
\[|T_i - T| < 10^{-12}\]then the goal \(G_i\) is replaced instead of inserting a new entry.
- Parameters:
time (float) – Activation time of the goal, interpreted according to
time_units.goal (Goal) – Goal instance to activate at the specified time.
time_units (Literal["centuries","seconds"] or None) – Optional per-call override of time units. Must be
"centuries"or"seconds". If omitted, the instance defaultself.time_unitsis used.
- Returns:
None
- Return type:
None
- get_active_goal(t, *, time_units=None)[source]¶
Return the goal active at a given time.
This method evaluates the piecewise-constant mapping
\[G(T) = \arg\max_{G_i} \{ T_i \le T \}\]using binary search on the internal Julian-centuries timeline. Computational complexity is
\[\mathcal{O}(\log N)\]where \(N\) is the number of defined goals.
By default, the instance’s
time_unitsis used to interprett. Alternatively,time_unitsmay be provided per-call to override the interpretation.If
time_units="centuries":tis a Julian-centuries value.If
time_units="seconds":tis seconds relative tostart_juliantimeand is converted internally.
If the timeline is empty, a
No_Goalinstance is returned.If \(T < T_0\), the first goal \(G_0\) is returned.
- Parameters:
t (float) – Query time, interpreted according to
time_units.time_units (Literal["centuries","seconds"] or None) – Optional per-call override of time units. Must be
"centuries"or"seconds". If omitted, the instance defaultself.time_unitsis used.
- Returns:
The active goal at time
t.- Return type:
- to_ref(t, os0, *, time_units=None)[source]¶
Compute the reference definition associated with the active goal.
This method first determines the active goal \(G(T)\) for the internal Julian-centuries time corresponding to the provided
t, and then delegates reference generation to\[( \mathbf{r}_{\text{ref}}, \boldsymbol{\omega}_{\text{ref}} ) = G(T).\texttt{to\_ref}( \mathcal{O}(T) )\]where \(\mathcal{O}(\cdot)\) denotes the current orbital state.
The semantic meaning of the returned arrays is defined by the concrete implementation of
Goal.Note
GoalListdoes not modifyos0. The time argumenttis used only to select which goal is active.By default, the instance’s
time_unitsis used to interprett. Alternatively,time_unitsmay be provided per-call to override the interpretation.- Parameters:
t (float) – Current mission time, interpreted according to
time_units.os0 (Orbital_State) – Current orbital state.
time_units (Literal["centuries","seconds"] or None) – Optional per-call override of time units. Must be
"centuries"or"seconds". If omitted, the instance defaultself.time_unitsis used.
- Returns:
Reference definition produced by the active goal.
- Return type:
Tuple[numpy.ndarray, numpy.ndarray]