<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Advanced
Step1:  As always, let's do imports and initialize a logger and a new Bundle.  See Building a System for more details.
Step2:  And we'll attach some dummy datasets.  See Datasets for more details.
Step3:  Available Backends
See the Compute Tutorial for details on adding compute options and using them to create synthetic models.
PHOEBE 1.0 Legacy
For more details, see Comparing PHOEBE 2.0 vs PHOEBE Legacy
Step4:  Using Alternate Backends
Adding Compute Options
Adding a set of compute options, via b.add_compute for an alternate backend is just as easy as for the PHOEBE backend.  Simply provide the function or name of the function in phoebe.parameters.compute that points to the parameters for that backend.
Here we'll add the default PHOEBE backend as well as the PHOEBE 1.0 (legacy) backend.  Note that in order to use an alternate backend, that backend must be installed on your machine.
Step5:  Running Compute
Nothing changes when calling b.run_compute - simply provide the compute tag for those options.  Do note, however, that not all backends support all dataset types.
But, since the legacy backend doesn't support ck2004 atmospheres and interpolated limb-darkening, we do need to choose a limb-darkening law.  We can do this for all passband-component combinations by using set_value_all.
Step6:  Running Multiple Backends Simultaneously
Running multiple backends simultaneously is just as simple as running the PHOEBE backend with multiple sets of compute options (see Compute).
We just need to make sure that each dataset is only enabled for one (or none) of the backends that we want to use, and then send a list of the compute tags to run_compute.  Here we'll use the PHOEBE backend to compute orbits and the legacy backend to compute light curves.
Step7:  The parameters inside the returned model even remember which set of compute options (and therefore, in this case, which backend) were used to compute them.
<ASSISTANT_TASK:>
Python Code:
!pip install -I "phoebe>=2.2,<2.3"
Explanation: Advanced: Alternate Backends
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
b.add_dataset('orb', times=np.linspace(0,10,1000), dataset='orb01', component=['primary', 'secondary'])
b.add_dataset('lc', times=np.linspace(0,10,1000), dataset='lc01')
Explanation: And we'll attach some dummy datasets.  See Datasets for more details.
End of explanation
b.add_compute('legacy', compute='legacybackend')
print(b.get_compute('legacybackend'))
Explanation: Available Backends
See the Compute Tutorial for details on adding compute options and using them to create synthetic models.
PHOEBE 1.0 Legacy
For more details, see Comparing PHOEBE 2.0 vs PHOEBE Legacy
End of explanation
b.add_compute('phoebe', compute='phoebebackend')
print(b.get_compute('phoebebackend'))
Explanation: Using Alternate Backends
Adding Compute Options
Adding a set of compute options, via b.add_compute for an alternate backend is just as easy as for the PHOEBE backend.  Simply provide the function or name of the function in phoebe.parameters.compute that points to the parameters for that backend.
Here we'll add the default PHOEBE backend as well as the PHOEBE 1.0 (legacy) backend.  Note that in order to use an alternate backend, that backend must be installed on your machine.
End of explanation
b.set_value_all('ld_mode', 'manual')
b.set_value_all('ld_func', 'logarithmic')
b.run_compute('legacybackend', model='legacyresults')
Explanation: Running Compute
Nothing changes when calling b.run_compute - simply provide the compute tag for those options.  Do note, however, that not all backends support all dataset types.
But, since the legacy backend doesn't support ck2004 atmospheres and interpolated limb-darkening, we do need to choose a limb-darkening law.  We can do this for all passband-component combinations by using set_value_all.
End of explanation
b.set_value_all('enabled@lc01@phoebebackend', False)
#b.set_value_all('enabled@orb01@legacybackend', False)  # don't need this since legacy NEVER computes orbits
print(b.filter(qualifier='enabled'))
b.run_compute(['phoebebackend', 'legacybackend'], model='mixedresults')
Explanation: Running Multiple Backends Simultaneously
Running multiple backends simultaneously is just as simple as running the PHOEBE backend with multiple sets of compute options (see Compute).
We just need to make sure that each dataset is only enabled for one (or none) of the backends that we want to use, and then send a list of the compute tags to run_compute.  Here we'll use the PHOEBE backend to compute orbits and the legacy backend to compute light curves.
End of explanation
print(b['mixedresults'].computes)
b['mixedresults@phoebebackend'].datasets
b['mixedresults@legacybackend'].datasets
Explanation: The parameters inside the returned model even remember which set of compute options (and therefore, in this case, which backend) were used to compute them.
End of explanation
<END_TASK>