Skip to main content
`Ctrl`+`K`

# PhaseConstraint

class astroplan.PhaseConstraint(periodic_event, min=None, max=None)

  Bases: `Constraint`

  Constrain observations to times in some range of phases for a periodic event (e.g.~transiting exoplanets, eclipsing binaries).

  Parameters:
    periodic_event `PeriodicEvent` or subclass

      System on which to compute the phase. For example, the system could be an eclipsing or non-eclipsing binary, or exoplanet system.

    min float (optional)

      Minimum phase (inclusive) on interval [0, 1). Default is zero.

    max float (optional)

      Maximum phase (inclusive) on interval [0, 1). Default is one.

  Examples

  To constrain observations on orbital phases between 0.4 and 0.6, >>> from astroplan import PeriodicEvent >>> from astropy.time import Time >>> import astropy.units as u >>> binary = PeriodicEvent(epoch=Time(‘2017-01-01 02:00’), period=1*u.day) >>> constraint = PhaseConstraint(binary, min=0.4, max=0.6)

  The minimum and maximum phase must be described on the interval [0, 1). To constrain observations on orbital phases between 0.6 and 1.2, for example, you should subtract one from the second number: >>> constraint = PhaseConstraint(binary, min=0.6, max=0.2)

  Methods Summary

  `compute_constraint`(times[, observer, targets]) | Actually do the real work of computing the constraint.

  Methods Documentation

  compute_constraint(times, observer=None, targets=None)

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

    Parameters:
      times `Time`

        The times to compute the constraint

      observer `Observer`

        the observaton location from which to apply the constraints

      targets sequence of `Target`

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