nenupy.schedule.constraints.MeridianTransitCnst

class nenupy.schedule.constraints.MeridianTransitCnst(weight=1)[source]

Bases: TargetConstraint

Meridian 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.

__init__(weight=1)[source]

Methods

__init__([weight])

get_score(indices)

Computes the MeridianTransitCnst's score for the given indices.

plot([fig, ax])

Plot the constraint's score previously evaluated.

Attributes

weight

Relative weight associated to the constraint.

get_score(indices)[source]

Computes the MeridianTransitCnst’s score for the given indices.

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.

Parameters:

indices (ndarray) – Indices of score on which the score will be evaluated.

Returns:

Constraint score.

Return type:

float

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 default None (i.e., a new Figure will be created)

  • ax (Axes) – Ax instance to re-use for plotting purposes, by default None (i.e., a new Axes will 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 (see matplotlib.pyplot.plot()), by default '.'

  • linestyle (str) – Plot line style (see matplotlib.pyplot.plot()), by default ':'

  • linewidth (int) – Plot line width (see matplotlib.pyplot.plot()), by default 1

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.