Let's first make sure we have the latest version of PHOEBE 2.1 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.1,<2.2"
In this tutorial we will review the changes in the PHOEBE mesh structures. We will first explain the changes and then demonstrate them in code. As usual, let us import phoebe and create a default binary bundle:
In [1]:
import phoebe
b = phoebe.default_binary()
PHOEBE 2.0 had a mesh dataset along with pbmesh
and protomesh
options you could send to b.run_compute(). These options were quite convenient, but had a few inherit problems:
pbmesh=True
, but only if the times matched exactly with the passband (lc, rv, etc) dataset.Addressing these shortcomings required a complete redesign of the mesh dataset. The most important changes are:
pbmesh
and protomesh
are no longer valid options to b.run_compute(). Everything is done through the mesh dataset itself, i.e. b.add_dataset('mesh')
.columns
parameter in the mesh dataset lists additional columns to be exposed in the model mesh when calling b.run_compute(). See the section on columns below for more details.include_times
parameter allows for importing timestamps from other datasets. It also provides support for important orbital times: 't0' (zero-point), 't0_perpass' (periastron passage), 't0_supconj' (superior conjunction) and 't0_ref' (zero-phase reference point).times
parameter is empty. If you do not set times
or include_times
before calling b.run_compute(), your model will be empty.This parameter is a SelectParameter (a new type of Parameter introduced in PHOEBE 2.1). Its value is one of the values in a list of allowed options. You can list the options by calling param.get_choices() (same as you would for a ChoiceParameter). The value also accepts wildcards, as long as the expression matches at least one of the choices. This allows you to easily select, say, rvs
from all datasets, by passing rvs@*
. To see the full list of matched options, use param.expand_value().
To demonstrate, let us add a few datasets and look at the available choices for the columns
parameter.
In [2]:
b.add_dataset('mesh')
print b.get_parameter('columns').get_choices()
In [3]:
b.add_dataset('lc')
print b.get_parameter('columns').get_choices()
In [4]:
b['columns'] = ['*@lc01', 'teffs']
b.get_parameter('columns').get_value()
Out[4]:
In [5]:
b.get_parameter('columns').expand_value()
Out[5]:
Similarly, the include_times
parameter is a SelectParameter, with the choices being the existing datasets, as well as the t0s mentioned above.
In [6]:
print b.get_parameter('include_times').get_value()
In [7]:
print b.get_parameter('include_times').get_choices()
In [8]:
b['include_times'] = ['lc01', 't0@system']
In [9]:
print b.get_parameter('include_times').get_value()