nenupy.schedule.constraints.MeridianTransitCnst
- class nenupy.schedule.constraints.MeridianTransitCnst(weight=1)[source]
Bases:
TargetConstraintMeridian Transit constraint
Added in version 1.2.0.
- __call__(*arg)
Evaluate the constraint against the schedule properties.
- Returns:
The constraint score evaluated at each time step.
- Return type:
ndarray- Raises:
AttributeError – If the constraint does not have an
_evaluate()method.
Methods
__init__([weight])get_score(indices)Computes the
MeridianTransitCnst's score for the givenindices.plot([fig, ax])Plot the constraint's score previously evaluated.
Attributes
Relative weight associated to the constraint.
- get_score(indices)[source]
Computes the
MeridianTransitCnst’s score for the givenindices.Returns 1 if the merdian transit is within the indices
The score is computed as:
\[\begin{split}{\rm score} = \begin{cases} 1, t_{\rm transit} \in \mathbf{t}({\rm indices})\\ 0, t_{\rm transit} \notin \mathbf{t}({\rm indices}) \end{cases}\end{split}\]where \(t_{\rm transit}\) is the meridian transit time and \(\mathbf{t}\) is the time range on which the target positions are computed.
- plot(fig=None, ax=None, **kwargs)
Plot the constraint’s score previously evaluated.
- Parameters:
fig (
Figure) – Figure instance to re-use for plotting purposes, by defaultNone(i.e., a newFigurewill be created)ax (
Axes) – Ax instance to re-use for plotting purposes, by defaultNone(i.e., a newAxeswill be created)figsize ([
float,float]) – Size of the figure, by default(10, 5)figname (
str) – Name of the figure to be saved, by default''(i.e., the figure is only displayed)marker (
str) – Plot marker type (seematplotlib.pyplot.plot()), by default'.'linestyle (
str) – Plot line style (seematplotlib.pyplot.plot()), by default':'linewidth (
int) – Plot line width (seematplotlib.pyplot.plot()), by default1
- property weight
Relative weight associated to the constraint. The constraint score of an observation block within a given schedule is ultimately taken at the weighted mean among all the constraints associated to this observaiton request.