<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Complete Binary Animation
NOTE
Step1:  As always, let's do imports and initialize a logger and a new bundle.  See Building a System for more details.
Step2:  Adding Datasets
Step3:  Running Compute
Step4:  Plotting
See the Animations Tutorial for more examples and details.
Here we'll create a figure with multiple subplots.  The top row will be the light curve and RV curve.  The bottom three subplots will be various representations of the mesh (intensities, rvs, and visibilities).
We'll do this by making separate calls to plot, passing the matplotlib subplot location for each axes we want to create.  We can then call b.show(animate=True) or b.save('anim.gif', animate=True).
<ASSISTANT_TASK:>
Python Code:
!pip install -I "phoebe>=2.2,<2.3"
Explanation: Complete Binary Animation
NOTE: animating within Jupyter notebooks can be very resource intensive.  This script will likely run much quicker as a Python script.
Setup
Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).
End of explanation
import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt
logger = phoebe.logger()
b = phoebe.default_binary()
Explanation: As always, let's do imports and initialize a logger and a new bundle.  See Building a System for more details.
End of explanation
times = np.linspace(0,1,21)
b.add_dataset('lc', times=times, dataset='lc01')
b.add_dataset('rv', times=times, dataset='rv01')
b.add_dataset('mesh', times=times, columns=['visibilities', 'intensities@lc01', 'rvs@rv01'], dataset='mesh01')
Explanation: Adding Datasets
End of explanation
b.run_compute(irrad_method='none')
Explanation: Running Compute
End of explanation
b['lc01@model'].plot(axpos=221)
b['rv01@model'].plot(c={'primary': 'blue', 'secondary': 'red'}, linestyle='solid', axpos=222)
b['mesh@model'].plot(fc='intensities@lc01', ec='None', axpos=425)
b['mesh@model'].plot(fc='rvs@rv01', ec='None', axpos=427)
b['mesh@model'].plot(fc='visibilities', ec='None', y='ws', axpos=224)
fig = plt.figure(figsize=(11,4))
afig, mplanim = b.savefig('animation_binary_complete.gif', fig=fig, tight_layouot=True, draw_sidebars=False, animate=True, save_kwargs={'writer': 'imagemagick'})
Explanation: Plotting
See the Animations Tutorial for more examples and details.
Here we'll create a figure with multiple subplots.  The top row will be the light curve and RV curve.  The bottom three subplots will be various representations of the mesh (intensities, rvs, and visibilities).
We'll do this by making separate calls to plot, passing the matplotlib subplot location for each axes we want to create.  We can then call b.show(animate=True) or b.save('anim.gif', animate=True).
End of explanation
<END_TASK>