LogicalAndConstraint#

class m4opt.constraints.LogicalAndConstraint(*operands)[source] [edit on github]#

Bases: LogicalReductionConstraint

Combine two or more constraints using a logical “and” operation.

Examples

>>> from astropy.coordinates import EarthLocation, SkyCoord
>>> from astropy.time import Time
>>> from astropy import units as u
>>> from m4opt.constraints import (
...     AtNightConstraint, LogicalAndConstraint, SunSeparationConstraint)
>>> constraint = (
...     AtNightConstraint.twilight_astronomical() &
...     SunSeparationConstraint(40 * u.deg))
>>> time = Time("2017-08-17T00:41:04Z")
>>> target = SkyCoord.from_name("NGC 4993")
>>> location = EarthLocation.of_site("Rubin Observatory")
>>> constraint(location, target, time)
np.True_
Parameters:

operands (Constraint)