<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 astroplan demo
Step1:  Make a list of constraints to compute
Step2:  Now combine those constraint results with non-trivial boolean logic
Step3:  Simple visualization of this combined constraint result, white pixels = constraints are met, black pixels = constraints are not met.
<ASSISTANT_TASK:>
Python Code:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from astropy.time import Time
import astropy.units as u
from astroplan import Observer, FixedTarget
# Observe from Keck
obs = Observer.at_site("Keck")
# Observe these three stars
name_list = ['vega', 'rigel', 'sirius']
target_list = [FixedTarget.from_name(name) for name in name_list]
# Check constraints once an hour for one day
times = Time.now() + u.Quantity(range(24), unit=u.hour)
Explanation: astroplan demo: boolean combinations of constraints
for @astrofrog by @bmorris3!
Construct an observer, targets, times:
End of explanation
from astroplan import (AltitudeConstraint, MoonSeparationConstraint, 
                       AtNightConstraint)
from astropy.time import Time
# Make an instance of each constraint
constraint1 = AltitudeConstraint(min=25*u.deg)
constraint2 = AtNightConstraint.twilight_astronomical()
constraint3 = MoonSeparationConstraint(min=30*u.deg)
# Apply each constraint, store each result separately
c1, c2, c3 = [c(obs, target_list, times) 
              for c in [constraint1, constraint2, constraint3]]
# Show one result
print("AltitudeConstraint result: (col=time, row=target)\n{0}".format(c1))
Explanation: Make a list of constraints to compute:
End of explanation
combination = (c1 & c2) | c3
combination
Explanation: Now combine those constraint results with non-trivial boolean logic:
End of explanation
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(12, 3))
ax.imshow(combination, interpolation='nearest', origin='lower', cmap=plt.cm.binary_r)
ax.set_yticks(range(3))
ax.set_yticklabels([t.name for t in target_list])
time_inds = range(24)[::2]
ax.set_xticks(time_inds)
ax.set_xticklabels([t.datetime.strftime("%H:%M") for t in times[time_inds]])
ax.set_title("(AltitudeConstraint & AtNightConstraint) | MoonSeparationConstraint");
Explanation: Simple visualization of this combined constraint result, white pixels = constraints are met, black pixels = constraints are not met.
End of explanation
<END_TASK>