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).
In [ ]:
!pip install -I "phoebe>=2.2,<2.3"
As always, let's do imports and initialize a logger and a new Bundle. See Building a System for more details.
In [1]:
%matplotlib inline
In [2]:
import phoebe
from phoebe import u # units
logger = phoebe.logger()
b = phoebe.default_binary()
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.
In [3]:
b.add_dataset('lc')
print(b.get_dataset(kind='lc', check_visible=False))
In [4]:
print(b.get_parameter(qualifier='times'))
In [5]:
print(b.get_parameter(qualifier='fluxes'))
In [6]:
print(b.get_parameter(qualifier='sigmas'))
See the Compute Times & Phases tutorial.
In [7]:
print(b.get_parameter(qualifier='compute_times'))
In [8]:
print(b.get_parameter(qualifier='compute_phases', context='dataset'))
In [9]:
print(b.get_parameter(qualifier='compute_phases_t0'))
See the Limb Darkening tutorial
In [10]:
print(b.get_parameter(qualifier='ld_mode', component='primary'))
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.
In [11]:
b.set_value('ld_mode', component='primary', value='lookup')
In [12]:
print(b.get_parameter(qualifier='ld_func', component='primary'))
ld_coeffs_source
will only be available if ld_mode
is 'lookup'. See the limb darkening tutorial for more details.
In [13]:
print(b.get_parameter(qualifier='ld_coeffs_source', component='primary'))
ld_coeffs
will only be available if ld_mode
is set to 'manual'. See the limb darkening tutorial for more details.
In [14]:
b.set_value('ld_mode', component='primary', value='manual')
In [15]:
print(b.get_parameter(qualifier='ld_coeffs', component='primary'))
See the Atmospheres & Passbands tutorial
In [16]:
print(b.get_parameter(qualifier='passband'))
See the Intensity Weighting tutorial
In [17]:
print(b.get_parameter(qualifier='intens_weighting'))
See the Passband Luminosity tutorial
In [18]:
print(b.get_parameter(qualifier='pblum_mode'))
pblum_component
is only available if pblum_mode
is set to 'component-coupled'. See the passband luminosity tutorial for more details.
In [19]:
b.set_value('pblum_mode', value='component-coupled')
In [20]:
print(b.get_parameter(qualifier='pblum_component'))
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.
In [21]:
b.set_value('pblum_mode', value='dataset-coupled')
In [22]:
print(b.get_parameter(qualifier='pblum_dataset'))
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.
In [23]:
b.set_value('pblum_mode', value='decoupled')
In [24]:
print(b.get_parameter(qualifier='pblum', component='primary'))
See the "Third" Light tutorial
In [26]:
print(b.get_parameter(qualifier='l3_mode'))
l3
is only avaible if l3_mode
is set to 'flux'. See the "Third" Light tutorial for more details.
In [27]:
b.set_value('l3_mode', value='flux')
In [28]:
print(b.get_parameter(qualifier='l3'))
l3_frac
is only avaible if l3_mode
is set to 'fraction'. See the "Third" Light tutorial for more details.
In [29]:
b.set_value('l3_mode', value='fraction')
In [30]:
print(b.get_parameter(qualifier='l3_frac'))
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:
In [31]:
print(b.get_compute())
In [32]:
print(b.get_parameter(qualifier='lc_method'))
In [33]:
print(b.get_parameter(qualifier='irrad_method'))
For more details on irradiation, see the Irradiation tutorial
In [34]:
print(b.get_parameter(qualifier='boosting_method'))
For more details on boosting, see the Beaming and Boosting example script
In [35]:
print(b.get_parameter(qualifier='atm', component='primary'))
For more details on atmospheres, see the Atmospheres & Passbands tutorial
In [36]:
b.set_value('times', phoebe.linspace(0,1,101))
In [37]:
b.run_compute()
Out[37]:
In [38]:
print(b.filter(context='model').twigs)
In [39]:
print(b.get_parameter(qualifier='times', kind='lc', context='model'))
In [40]:
print(b.get_parameter(qualifier='fluxes', kind='lc', context='model'))
In [41]:
afig, mplfig = b.plot(show=True)
Since these are the only two columns available in the synthetic model, the only other option is to plot in phase instead of time.
In [42]:
afig, mplfig = b.plot(x='phases', show=True)
In system hierarchies where there may be multiple periods, it is also possible to determine whose period to use for phasing.
In [43]:
print(b.filter(qualifier='period').components)
In [44]:
afig, mplfig = b.plot(x='phases:binary', show=True)
In [45]:
b.add_dataset('mesh', times=[0], dataset='mesh01')
Out[45]:
In [46]:
print(b.get_parameter(qualifier='columns').choices)
In [47]:
b.set_value('columns', value=['intensities@lc01',
'abs_intensities@lc01',
'normal_intensities@lc01',
'abs_normal_intensities@lc01',
'pblum_ext@lc01',
'boost_factors@lc01'])
In [48]:
b.run_compute()
Out[48]:
In [49]:
print(b.get_model().datasets)
These new columns are stored with the lc's dataset tag, but with the 'mesh' dataset-kind.
In [50]:
print(b.filter(dataset='lc01', kind='mesh', context='model').twigs)
Any of these columns are then available to use as edge or facecolors when plotting the mesh (see the section on the mesh dataset).
In [51]:
afig, mplfig = b.filter(kind='mesh').plot(fc='intensities', ec='None', show=True)
Now let's look at each of the available fields.
For more details, see the tutorial on Passband Luminosities
In [52]:
print(b.get_parameter(qualifier='pblum_ext',
component='primary',
dataset='lc01',
kind='mesh',
context='model'))
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.
In [53]:
print(b.get_parameter(qualifier='abs_normal_intensities',
component='primary',
dataset='lc01',
kind='mesh',
context='model'))
abs_normal_intensities
are the absolute normal intensities per-element.
In [54]:
print(b.get_parameter(qualifier='normal_intensities',
component='primary',
dataset='lc01',
kind='mesh',
context='model'))
normal_intensities
are the relative normal intensities per-element.
In [55]:
print(b.get_parameter(qualifier='abs_intensities',
component='primary',
dataset='lc01',
kind='mesh',
context='model'))
abs_intensities
are the projected absolute intensities (towards the observer) per-element.
In [56]:
print(b.get_parameter(qualifier='intensities',
component='primary',
dataset='lc01',
kind='mesh',
context='model'))
intensities
are the projected relative intensities (towards the observer) per-element.
In [57]:
print(b.get_parameter(qualifier='boost_factors',
component='primary',
dataset='lc01',
kind='mesh',
context='model'))
boost_factors
are the boosting amplitudes per-element. See the boosting tutorial for more details.