LocalTimeConstraint¶
-
class
astroplan.LocalTimeConstraint(min=None, max=None)[source]¶ Bases:
astroplan.ConstraintConstrain the observable hours.
Parameters: min :
timeEarliest local time (inclusive).
Noneindicates no limit.max :
timeLatest local time (inclusive).
Noneindicates no limit.Examples
Constrain the observations to targets that are observable between 23:50 and 04:08 local time:
>>> from astroplan import Observer >>> from astroplan.constraints import LocalTimeConstraint >>> import datetime as dt >>> subaru = Observer.at_site("Subaru", timezone="US/Hawaii") >>> # bound times between 23:50 and 04:08 local Hawaiian time >>> constraint = LocalTimeConstraint(min=dt.time(23,50), max=dt.time(4,8))
Methods Summary
compute_constraint(times, observer, targets)Actually do the real work of computing the constraint. Methods Documentation
-
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.
-