Constraint¶
-
class
astroplan.Constraint[source]¶ Bases:
objectAbstract 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: observer :
Observerthe observation location from which to apply the constraints
targets : sequence of
TargetThe targets on which to apply the constraints.
times :
TimeThe times to compute the constraint. WHAT HAPPENS WHEN BOTH TIMES AND TIME_RANGE ARE SET?
time_range :
Time(length = 2)Lower and upper bounds on time sequence.
time_grid_resolution :
quantityTime-grid spacing
grid_times_targets : bool
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_result : 1D or 2D array of float or bool
The constraints. If 2D with targets along the first index and times along the second.
-
compute_constraint(times, observer, targets)[source]¶ Actually do the real work of computing the constraint. Subclasses override this.
Parameters: times :
TimeThe times to compute the constraint
observer :
Observerthe observaton location from which to apply the constraints
targets : sequence of
TargetThe targets on which to apply the constraints.
Returns: constraint_result : 2D array of float or bool
The constraints, with targets along the first index and times along the second.
-