<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 'lc' Datasets and Options
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
Step1:  As always, let's do imports and initialize a logger and a new Bundle.
Step2:  Dataset Parameters
Let's add a lightcurve dataset to the Bundle (see also the lc API docs).  Some parameters are only visible based on the values of other parameters, so we'll pass check_visible=False (see the filter API docs for more details).  These visibility rules will be explained below.
Step3:  times
Step4:  fluxes
Step5:  sigmas
Step6:  compute_times / compute_phases
See the Compute Times & Phases tutorial.
Step7:  NOTE
Step8:  ld_mode
See the Limb Darkening tutorial
Step9:  ld_func
ld_func will only be available if ld_mode is not 'interp', so let's set it to 'lookup'.  See the limb darkening tutorial for more details.
Step10:  ld_coeffs_source
ld_coeffs_source will only be available if ld_mode is 'lookup'.  See the limb darkening tutorial for more details.
Step11:  ld_coeffs
ld_coeffs will only be available if ld_mode is set to 'manual'.  See the limb darkening tutorial for more details.
Step12:  passband
See the Atmospheres & Passbands tutorial
Step13:  intens_weighting
See the Intensity Weighting tutorial
Step14:  pblum_mode
See the Passband Luminosity tutorial
Step15:  pblum_component
pblum_component is only available if pblum_mode is set to 'component-coupled'.  See the passband luminosity tutorial for more details.
Step16:  pblum_dataset
pblum_dataset is only available if pblum_mode is set to 'dataset-coupled'.  In this case we'll get a warning because there is only one dataset.  See the passband luminosity tutorial for more details.
Step17:  pblum
pblum is only available if pblum_mode is set to 'decoupled' (in which case there is a pblum entry per-star) or 'component-coupled' (in which case there is only an entry for the star chosen by pblum_component).  See the passband luminosity tutorial for more details.
Step18:  l3_mode
See the "Third" Light tutorial
Step19:  l3
l3 is only avaible if l3_mode is set to 'flux'.  See the "Third" Light tutorial for more details.
Step20:  l3_frac
l3_frac is only avaible if l3_mode is set to 'fraction'.  See the "Third" Light tutorial for more details.
Step21:  Compute Options
Let's look at the compute options (for the default PHOEBE 2 backend) that relate to computing fluxes and the LC dataset.
Other compute options are covered elsewhere
Step22:  irrad_method
Step23:  For more details on irradiation, see the Irradiation tutorial
boosting_method
Step24:  For more details on boosting, see the Beaming and Boosting example script
atm
Step25:  For more details on atmospheres, see the Atmospheres & Passbands tutorial
Synthetics
Step26:  Plotting
By default, LC datasets plot as flux vs time.
Step27:  Since these are the only two columns available in the synthetic model, the only other option is to plot in phase instead of time.
Step28:  In system hierarchies where there may be multiple periods, it is also possible to determine whose period to use for phasing.
Step29:  Mesh Fields
By adding a mesh dataset and setting the columns parameter, light-curve (i.e. passband-dependent) per-element quantities can be exposed and plotted.
Let's add a single mesh at the first time of the light-curve and re-call run_compute
Step30:  These new columns are stored with the lc's dataset tag, but with the 'mesh' dataset-kind.
Step31:  Any of these columns are then available to use as edge or facecolors when plotting the mesh (see the section on the mesh dataset).
Step32:  Now let's look at each of the available fields.
pblum
For more details, see the tutorial on Passband Luminosities
Step33:  pblum_ext is the extrinsic passband luminosity of the entire star/mesh - this is a single value (unlike most of the parameters in the mesh) and does not have per-element values.
abs_normal_intensities
Step34:  abs_normal_intensities are the absolute normal intensities per-element.
normal_intensities
Step35:  normal_intensities are the relative normal intensities per-element.
abs_intensities
Step36:  abs_intensities are the projected absolute intensities (towards the observer) per-element.
intensities
Step37:  intensities are the projected relative intensities (towards the observer) per-element.
boost_factors
<ASSISTANT_TASK:>
Python Code:
#!pip install -I "phoebe>=2.3,<2.4"
Explanation: 'lc' Datasets and Options
Setup
Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
import phoebe
from phoebe import u # units
logger = phoebe.logger()
b = phoebe.default_binary()
Explanation: As always, let's do imports and initialize a logger and a new Bundle.
End of explanation
b.add_dataset('lc')
print(b.get_dataset(kind='lc', check_visible=False))
Explanation: Dataset Parameters
Let's add a lightcurve dataset to the Bundle (see also the lc API docs).  Some parameters are only visible based on the values of other parameters, so we'll pass check_visible=False (see the filter API docs for more details).  These visibility rules will be explained below.
End of explanation
print(b.get_parameter(qualifier='times'))
Explanation: times
End of explanation
print(b.get_parameter(qualifier='fluxes'))
Explanation: fluxes
End of explanation
print(b.get_parameter(qualifier='sigmas'))
Explanation: sigmas
End of explanation
print(b.get_parameter(qualifier='compute_times'))
print(b.get_parameter(qualifier='compute_phases', context='dataset'))
Explanation: compute_times / compute_phases
See the Compute Times & Phases tutorial.
End of explanation
print(b.get_parameter(qualifier='phases_t0'))
Explanation: NOTE: phases_t0 was called compute_phases_t0 before the 2.3 release.
End of explanation
print(b.get_parameter(qualifier='ld_mode', component='primary'))
Explanation: ld_mode
See the Limb Darkening tutorial
End of explanation
b.set_value('ld_mode', component='primary', value='lookup')
print(b.get_parameter(qualifier='ld_func', component='primary'))
Explanation: ld_func
ld_func will only be available if ld_mode is not 'interp', so let's set it to 'lookup'.  See the limb darkening tutorial for more details.
End of explanation
print(b.get_parameter(qualifier='ld_coeffs_source', component='primary'))
Explanation: ld_coeffs_source
ld_coeffs_source will only be available if ld_mode is 'lookup'.  See the limb darkening tutorial for more details.
End of explanation
b.set_value('ld_mode', component='primary', value='manual')
print(b.get_parameter(qualifier='ld_coeffs', component='primary'))
Explanation: ld_coeffs
ld_coeffs will only be available if ld_mode is set to 'manual'.  See the limb darkening tutorial for more details.
End of explanation
print(b.get_parameter(qualifier='passband'))
Explanation: passband
See the Atmospheres & Passbands tutorial
End of explanation
print(b.get_parameter(qualifier='intens_weighting'))
Explanation: intens_weighting
See the Intensity Weighting tutorial
End of explanation
print(b.get_parameter(qualifier='pblum_mode'))
Explanation: pblum_mode
See the Passband Luminosity tutorial
End of explanation
b.set_value('pblum_mode', value='component-coupled')
print(b.get_parameter(qualifier='pblum_component'))
Explanation: pblum_component
pblum_component is only available if pblum_mode is set to 'component-coupled'.  See the passband luminosity tutorial for more details.
End of explanation
b.set_value('pblum_mode', value='dataset-coupled')
print(b.get_parameter(qualifier='pblum_dataset'))
Explanation: pblum_dataset
pblum_dataset is only available if pblum_mode is set to 'dataset-coupled'.  In this case we'll get a warning because there is only one dataset.  See the passband luminosity tutorial for more details.
End of explanation
b.set_value('pblum_mode', value='decoupled')
print(b.get_parameter(qualifier='pblum', component='primary'))
Explanation: pblum
pblum is only available if pblum_mode is set to 'decoupled' (in which case there is a pblum entry per-star) or 'component-coupled' (in which case there is only an entry for the star chosen by pblum_component).  See the passband luminosity tutorial for more details.
End of explanation
print(b.get_parameter(qualifier='l3_mode'))
Explanation: l3_mode
See the "Third" Light tutorial
End of explanation
b.set_value('l3_mode', value='flux')
print(b.get_parameter(qualifier='l3'))
Explanation: l3
l3 is only avaible if l3_mode is set to 'flux'.  See the "Third" Light tutorial for more details.
End of explanation
b.set_value('l3_mode', value='fraction')
print(b.get_parameter(qualifier='l3_frac'))
Explanation: l3_frac
l3_frac is only avaible if l3_mode is set to 'fraction'.  See the "Third" Light tutorial for more details.
End of explanation
print(b.get_compute())
Explanation: Compute Options
Let's look at the compute options (for the default PHOEBE 2 backend) that relate to computing fluxes and the LC dataset.
Other compute options are covered elsewhere:
* parameters related to dynamics are explained in the section on the orb dataset
* parameters related to meshing, eclipse detection, and subdivision are explained in the section on the mesh dataset
End of explanation
print(b.get_parameter(qualifier='irrad_method'))
Explanation: irrad_method
End of explanation
print(b.get_parameter(qualifier='boosting_method'))
Explanation: For more details on irradiation, see the Irradiation tutorial
boosting_method
End of explanation
print(b.get_parameter(qualifier='atm', component='primary'))
Explanation: For more details on boosting, see the Beaming and Boosting example script
atm
End of explanation
b.set_value('times', phoebe.linspace(0,1,101))
b.run_compute()
print(b.filter(context='model').twigs)
print(b.get_parameter(qualifier='times', kind='lc', context='model'))
print(b.get_parameter(qualifier='fluxes', kind='lc', context='model'))
Explanation: For more details on atmospheres, see the Atmospheres & Passbands tutorial
Synthetics
End of explanation
afig, mplfig = b.plot(show=True)
Explanation: Plotting
By default, LC datasets plot as flux vs time.
End of explanation
afig, mplfig = b.plot(x='phases', show=True)
Explanation: Since these are the only two columns available in the synthetic model, the only other option is to plot in phase instead of time.
End of explanation
print(b.filter(qualifier='period').components)
afig, mplfig = b.plot(x='phases:binary', show=True)
Explanation: In system hierarchies where there may be multiple periods, it is also possible to determine whose period to use for phasing.
End of explanation
b.add_dataset('mesh', times=[0], dataset='mesh01')
print(b.get_parameter(qualifier='columns').choices)
b.set_value('columns', value=['intensities@lc01', 
                              'abs_intensities@lc01', 
                              'normal_intensities@lc01', 
                              'abs_normal_intensities@lc01', 
                              'pblum_ext@lc01', 
                              'boost_factors@lc01'])
b.run_compute()
print(b.get_model().datasets)
Explanation: Mesh Fields
By adding a mesh dataset and setting the columns parameter, light-curve (i.e. passband-dependent) per-element quantities can be exposed and plotted.
Let's add a single mesh at the first time of the light-curve and re-call run_compute
End of explanation
print(b.filter(dataset='lc01', kind='mesh', context='model').twigs)
Explanation: These new columns are stored with the lc's dataset tag, but with the 'mesh' dataset-kind.
End of explanation
afig, mplfig = b.filter(kind='mesh').plot(fc='intensities', ec='None', show=True)
Explanation: Any of these columns are then available to use as edge or facecolors when plotting the mesh (see the section on the mesh dataset).
End of explanation
print(b.get_parameter(qualifier='pblum_ext', 
                      component='primary', 
                      dataset='lc01', 
                      kind='mesh', 
                      context='model'))
Explanation: Now let's look at each of the available fields.
pblum
For more details, see the tutorial on Passband Luminosities
End of explanation
print(b.get_parameter(qualifier='abs_normal_intensities', 
                      component='primary', 
                      dataset='lc01', 
                      kind='mesh', 
                      context='model'))
Explanation: pblum_ext is the extrinsic passband luminosity of the entire star/mesh - this is a single value (unlike most of the parameters in the mesh) and does not have per-element values.
abs_normal_intensities
End of explanation
print(b.get_parameter(qualifier='normal_intensities', 
                      component='primary', 
                      dataset='lc01', 
                      kind='mesh', 
                      context='model'))
Explanation: abs_normal_intensities are the absolute normal intensities per-element.
normal_intensities
End of explanation
print(b.get_parameter(qualifier='abs_intensities', 
                      component='primary', 
                      dataset='lc01', 
                      kind='mesh', 
                      context='model'))
Explanation: normal_intensities are the relative normal intensities per-element.
abs_intensities
End of explanation
print(b.get_parameter(qualifier='intensities', 
                      component='primary', 
                      dataset='lc01', 
                      kind='mesh', 
                      context='model'))
Explanation: abs_intensities are the projected absolute intensities (towards the observer) per-element.
intensities
End of explanation
print(b.get_parameter(qualifier='boost_factors', 
                      component='primary', 
                      dataset='lc01', 
                      kind='mesh', 
                      context='model'))
Explanation: intensities are the projected relative intensities (towards the observer) per-element.
boost_factors
End of explanation
<END_TASK>