Constraint

class astroplan.Constraint[source]

Bases: object

Abstract class for objects defining observational constraints.

Methods Summary

__call__(observer, targets[, times, ...])

Compute the constraint for this class

compute_constraint(times, observer, targets)

Actually do the real work of computing the constraint.

Methods Documentation

__call__(observer, targets, times=None, time_range=None, time_grid_resolution=<Quantity 0.5 h>, grid_times_targets=False)[source]

Compute the constraint for this class

Parameters
observerObserver

the observation location from which to apply the constraints

targetssequence of Target

The targets on which to apply the constraints.

timesTime

The times to compute the constraint. WHAT HAPPENS WHEN BOTH TIMES AND TIME_RANGE ARE SET?

time_rangeTime (length = 2)

Lower and upper bounds on time sequence.

time_grid_resolutionquantity

Time-grid spacing

grid_times_targetsbool

if True, grids the constraint result with targets along the first index and times along the second. Otherwise, we rely on broadcasting the shapes together using standard numpy rules.

Returns
——-
constraint_result1D or 2D array of float or bool

The constraints. If 2D with targets along the first index and times along the second.

abstract compute_constraint(times, observer, targets)[source]

Actually do the real work of computing the constraint. Subclasses override this.

Parameters
timesTime

The times to compute the constraint

observerObserver

the observaton location from which to apply the constraints

targetssequence of Target

The targets on which to apply the constraints.

Returns
constraint_result2D array of float or bool

The constraints, with targets along the first index and times along the second.