<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Limb Darkening
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).
Step1:  As always, let's do imports and initialize a logger and a new bundle.  See Building a System for more details.
Step2:  We'll just add an 'lc' dataset
Step3:  Relevant Parameters
ld_mode_bol, ld_func_bol, ld_coeffs_source_bol, and ld_coeffs_bol are for bolometric limb-darkening, which is only currently used for irradiation/reflection.  These are per-component parameters that have context='component'.
Step4:  ld_mode_bol = 'lookup'
By default, ld_mode_bol is set to 'lookup', in which case the coefficients are pulled from the atmosphere table (according to ld_coeffs_source_bol) per-component (but not per-element).  Note that this differs slightly from the dataset-treatment where the lookup is handled per-element.
Step5:  To access the interpolated values that will be used under-the-hood, we can call b.compute_ld_coeffs.
(To only compute the bolometric quantities, pass dataset='bol')
Step6:  ld_mode_bol = 'manual'
To pass coefficients manually, we can change ld_mode_bol to 'manual'
Step7:  All other limb-darkening parameters (ld_mode, ld_func, ld_coeffs_source, and ld_coeffs) are per-component and per-dataset parameters with context='dataset'.
Step8:  ld_mode = 'interp'
Unlike bolometric limb-darkening, passband limb-darkening coefficients can be interpolated directly from atmosphere tables, this is the default case, with ld_mode set to 'interp'.  
Note that before PHOEBE 2.2, this was accomplished by setting ld_func to 'interp' (see this explanation for migrating from earlier versions).
Step9:  Note that ld_func, ld_coeffs_source, and ld_coeffs aren't visible (relevant) if ld_mode is set to  'interp' (which it is by default).
Step10:  ld_mode = 'lookup'
Setting the value of ld_mode to 'lookup' will expose the ld_func and ld_coeffs_source parameters.  Note that this behavior is slightly new as of PHOEBE 2.2 (see this explanation for migrating from earlier versions).
When set to 'lookup', then the limb-darkening will be interpolated per-element (for PHOEBE 2, other backends may interpolate per-star) for the function given in ld_func from the atmosphere table dictated by the ld_coeffs_source parameter (or the atm parameter and falling back on 'ck2004' if no match is found if ld_coeffs_source is set to 'auto').
Note that the bolometric ld_mode_bol of 'lookup' interpolates per-component, but not per-element.
Step11:  To manually choose an available atmosphere table, you can choose some other value ('ck2004', for example).
Step12:  Although not necesary, we can access the interpolated coefficients by calling b.compute_ld_coeffs.
Step13:  ld_mode = 'manual'
Setting the value of ld_mode to 'manual' will expose the ld_func and ld_coeffs parameters.  Again, note that this behavior is slightly new as of PHOEBE 2.2 (see this explanation for migrating from earlier versions).
In this case, we can manually provide the coefficients through the ld_coeffs parameter, keeping care that they are of the correct length for the given value of ld_func.  To ensure this is the case, call b.run_checks (or wait until b.run_compute which will raise an error if the length is in conflict).
<ASSISTANT_TASK:>
Python Code:
!pip install -I "phoebe>=2.2,<2.3"
Explanation: Limb Darkening
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
%matplotlib inline
import phoebe
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('lc', times=phoebe.linspace(0,1,101), dataset='lc01')
Explanation: We'll just add an 'lc' dataset
End of explanation
print(b['ld_mode_bol@primary'])
print(b['ld_func_bol@primary'])
print(b['ld_func_bol@primary'].choices)
Explanation: Relevant Parameters
ld_mode_bol, ld_func_bol, ld_coeffs_source_bol, and ld_coeffs_bol are for bolometric limb-darkening, which is only currently used for irradiation/reflection.  These are per-component parameters that have context='component'.
End of explanation
print(b['ld_coeffs_source_bol@primary'])
Explanation: ld_mode_bol = 'lookup'
By default, ld_mode_bol is set to 'lookup', in which case the coefficients are pulled from the atmosphere table (according to ld_coeffs_source_bol) per-component (but not per-element).  Note that this differs slightly from the dataset-treatment where the lookup is handled per-element.
End of explanation
b.compute_ld_coeffs(dataset='bol')
Explanation: To access the interpolated values that will be used under-the-hood, we can call b.compute_ld_coeffs.
(To only compute the bolometric quantities, pass dataset='bol')
End of explanation
b.set_value_all('ld_mode_bol', value='manual')
print(b['ld_coeffs_bol@primary'])
Explanation: ld_mode_bol = 'manual'
To pass coefficients manually, we can change ld_mode_bol to 'manual'
End of explanation
print(b.filter(qualifier='ld_mode', dataset='lc01'))
Explanation: All other limb-darkening parameters (ld_mode, ld_func, ld_coeffs_source, and ld_coeffs) are per-component and per-dataset parameters with context='dataset'.
End of explanation
print(b.get_parameter(qualifier='ld_mode', dataset='lc01', component='primary').choices)
Explanation: ld_mode = 'interp'
Unlike bolometric limb-darkening, passband limb-darkening coefficients can be interpolated directly from atmosphere tables, this is the default case, with ld_mode set to 'interp'.  
Note that before PHOEBE 2.2, this was accomplished by setting ld_func to 'interp' (see this explanation for migrating from earlier versions).
End of explanation
print(b.filter(qualifier='ld*', dataset='lc01'))
Explanation: Note that ld_func, ld_coeffs_source, and ld_coeffs aren't visible (relevant) if ld_mode is set to  'interp' (which it is by default).
End of explanation
b.set_value(qualifier='ld_mode', dataset='lc01', component='primary', value='lookup')
print(b.filter(qualifier='ld*', dataset='lc01', component='primary'))
Explanation: ld_mode = 'lookup'
Setting the value of ld_mode to 'lookup' will expose the ld_func and ld_coeffs_source parameters.  Note that this behavior is slightly new as of PHOEBE 2.2 (see this explanation for migrating from earlier versions).
When set to 'lookup', then the limb-darkening will be interpolated per-element (for PHOEBE 2, other backends may interpolate per-star) for the function given in ld_func from the atmosphere table dictated by the ld_coeffs_source parameter (or the atm parameter and falling back on 'ck2004' if no match is found if ld_coeffs_source is set to 'auto').
Note that the bolometric ld_mode_bol of 'lookup' interpolates per-component, but not per-element.
End of explanation
print(b.get_parameter(qualifier='ld_coeffs_source', dataset='lc01', component='primary'))
Explanation: To manually choose an available atmosphere table, you can choose some other value ('ck2004', for example).
End of explanation
print(b.compute_ld_coeffs(dataset='lc01'))
Explanation: Although not necesary, we can access the interpolated coefficients by calling b.compute_ld_coeffs.
End of explanation
b.set_value(qualifier='ld_mode', dataset='lc01', component='primary', value='manual')
print(b.filter(qualifier='ld*', dataset='lc01', component='primary'))
print(b.get_parameter(qualifier='ld_coeffs', dataset='lc01', component='primary'))
Explanation: ld_mode = 'manual'
Setting the value of ld_mode to 'manual' will expose the ld_func and ld_coeffs parameters.  Again, note that this behavior is slightly new as of PHOEBE 2.2 (see this explanation for migrating from earlier versions).
In this case, we can manually provide the coefficients through the ld_coeffs parameter, keeping care that they are of the correct length for the given value of ld_func.  To ensure this is the case, call b.run_checks (or wait until b.run_compute which will raise an error if the length is in conflict).
End of explanation
<END_TASK>