Skip to main content
`Ctrl`+`K`

# Scheduler

class astroplan.Scheduler(constraints, observer, transitioner=None, gap_time=5 * u.min, time_resolution=20 * u.second)

  Bases: `object`

  Schedule a set of `ObservingBlock` objects

  Parameters:
    constraints sequence of `Constraint`

      The constraints to apply to every observing block. Note that constraints for specific blocks can go on each block individually.

    observer `Observer`

      The observer/site to do the scheduling for.

    transitioner `Transitioner` (required)

      The object to use for computing transition times between blocks. Leaving it as `None` will cause an error.

    gap_time `Quantity` with time units

      The maximum length of time a transition between ObservingBlocks could take.

    time_resolution `Quantity` with time units

      The smallest factor of time used in scheduling, all Blocks scheduled will have a duration that is a multiple of it.

  Methods Summary

  `__call__`(blocks, schedule) | Schedule a set of `ObservingBlock` objects.
  `from_timespan`(center_time, duration, **kwargs) | Create a new instance of this class given a center time and duration.

  Methods Documentation

  __call__(blocks, schedule)

    Schedule a set of `ObservingBlock` objects.

    Parameters:
      blocks list of `ObservingBlock` objects

        The observing blocks to schedule. Note that the input `ObservingBlock` objects will not be modified - new ones will be created and returned.

      schedule `Schedule` object

        A schedule that the blocks will be scheduled in. At this time the `schedule` must be empty, only defined by a start and end time.

    Returns:
      schedule `Schedule`

        A schedule objects which consists of `Slot` objects with and without populated `block` objects containing either `TransitionBlock` or `ObservingBlock` objects with populated `start_time` and `end_time` or `duration` attributes

  classmethod from_timespan(center_time, duration, **kwargs)

    Create a new instance of this class given a center time and duration.

    Parameters:
      center_time `Time`

        Mid-point of time-span to schedule.

      duration `Quantity` or `TimeDelta`

        Duration of time-span to schedule