<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Comparing Contacts Binaries in PHOEBE 2 vs PHOEBE Legacy
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 and Compute Options
Step3:  Let's add compute options for phoebe using the new (marching) method for creating meshes.
Step4:  Now we add compute options for the 'legacy' backend.
Step5:  Let's use the external atmospheres available for both phoebe1 and phoebe2
Step6:  Set value of gridsize for the trapezoidal (WD) mesh.
Step7:  Let's also disable other special effect such as heating, gravity, and light-time effects.
Step8:  Finally, let's compute our models
Step9:  Plotting
Light Curve
Step10:  Now let's plot the residuals between these two models
Step11:  RVs
<ASSISTANT_TASK:>
Python Code:
!pip install -I "phoebe>=2.0,<2.1"
Explanation: Comparing Contacts Binaries in PHOEBE 2 vs PHOEBE Legacy
NOTE: PHOEBE 1.0 legacy is an alternate backend and is not installed with PHOEBE 2.0.  In order to run this backend, you'll need to have PHOEBE 1.0 installed.
Setup
Let's first make sure we have the latest version of PHOEBE 2.0 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
%matplotlib inline
import phoebe
from phoebe import u
import numpy as np
import matplotlib.pyplot as plt
logger = phoebe.logger()
b = phoebe.default_binary(contact_binary=True)
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
b.add_dataset('lc', times=np.linspace(0,1,101), dataset='lc01')
b.add_dataset('rv', times=np.linspace(0,1,101), dataset='rv01')
Explanation: Adding Datasets and Compute Options
End of explanation
b.add_compute('phoebe', compute='phoebe2', mesh_method='marching')
Explanation: Let's add compute options for phoebe using the new (marching) method for creating meshes.
End of explanation
b.add_compute('legacy', compute='phoebe1')
Explanation: Now we add compute options for the 'legacy' backend.
End of explanation
b.set_value_all('atm', 'extern_planckint')
Explanation: Let's use the external atmospheres available for both phoebe1 and phoebe2
End of explanation
b.set_value_all('gridsize', 30)
Explanation: Set value of gridsize for the trapezoidal (WD) mesh.
End of explanation
b.set_value_all('ld_func', 'logarithmic')
b.set_value_all('ld_coeffs', [0.0, 0.0])
b.set_value_all('refl_num',0)
b.set_value_all('rv_grav', False)
b.set_value_all('ltte', False)
Explanation: Let's also disable other special effect such as heating, gravity, and light-time effects.
End of explanation
b.run_compute(compute='phoebe2', model='phoebe2model', irrad_method='none')
b.run_compute(compute='phoebe1', model='phoebe1model')
Explanation: Finally, let's compute our models
End of explanation
axs, artists = b['lc01@phoebe2model'].plot(color='g')
axs, artists = b['lc01@phoebe1model'].plot(color='r')
leg = plt.legend(loc=4)
Explanation: Plotting
Light Curve
End of explanation
artist, = plt.plot(b.get_value('fluxes@lc01@phoebe2model') - b.get_value('fluxes@lc01@phoebe1model'), 'g-')
artist = plt.axhline(0.0, linestyle='dashed', color='k')
Explanation: Now let's plot the residuals between these two models
End of explanation
axs, artists = b['rv01@phoebe2model'].plot(color='g')
axs, artists = b['rv01@phoebe1model'].plot(color='r')
artist, = plt.plot(b.get_value('rvs@primary@phoebe2model', ) - b.get_value('rvs@primary@phoebe1model'), color='g', ls=':')
artist, = plt.plot(b.get_value('rvs@secondary@phoebe2model') - b.get_value('rvs@secondary@phoebe1model'), color='g', ls='-.')
artist = plt.axhline(0.0, linestyle='dashed', color='k')
ylim = plt.ylim(-1.5, 1.5)
Explanation: RVs
End of explanation
<END_TASK>