PHOEBE 2.1 Documentation

2.1 Docs

IPython Notebook | Python Script

Wilson-Devinney Style Meshing

NOTE: Wilson-Devinney Style meshing requires developer mode in PHOEBE and is meant to be used for testing, not used for science.


%matplotlib inline

As always, let’s do imports and initialize a logger and a new bundle. See Building a System for more details.

import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt


logger = phoebe.logger()

b = phoebe.default_binary()

Changing Meshing Options

Next we need to add compute options and change the mesh_style for all stars from ‘marching’ to ‘wd’

b.set_value_all('mesh_method', 'wd')
b.set_value_all('eclipse_method', 'graham')
Mon, 15 Oct 2018 17:14 PARAMETERS   WARNING all (or none) components must use mesh_method='wd'.  If not addressed, this warning will continue to be raised and will throw an error at run_compute.

Adding Datasets

Next let’s add a mesh dataset so that we can plot our Wilson-Devinney style meshes

b.add_dataset('mesh', times=np.linspace(0,10,6), dataset='mesh01', columns=['visibilities'])
<ParameterSet: 4 parameters | contexts: compute, dataset>

Running Compute

<ParameterSet: 38 parameters | components: primary, secondary>


afig, mplfig = b['mesh01@model'].plot(time=0.5, x='us', y='vs',
<matplotlib.figure.Figure at 0x7fab3168c650>

Now let’s zoom in so we can see the layout of the triangles. Note that Wilson-Devinney uses trapezoids, but since PHOEBE uses triangles, we take each of the trapezoids and split it into two triangles.

afig, mplfig = b['primary@mesh01@model'].plot(time=0.0,  x='us', y='vs',
                                              ec='blue', fc='gray',
                                              xlim=(-0.2,0.2), ylim=(-0.2,0.2),

And now looking down from above. Here you can see the gaps between the surface elements (and you can also see some of the subdivision that’s taking place along the limb).

afig, mplfig = b['primary@mesh01@model'].plot(time=0.0, x='us', y='ws',
                                              ec='blue', fc='gray',
                                              xlim=(-0.1,0.1), ylim=(-2.75,-2.55),

And see which elements are visible at the current time. This defaults to use the ‘RdYlGn’ colormap which will make visible elements green, partially hidden elements yellow, and hidden elements red. Note that the observer is in the positive w-direction.

afig, mplfig = b['secondary@mesh01@model'].plot(time=0.0, x='us', y='ws',
                                                ec='None', fc='visibilities',
Prev: Rossiter-McLaughlin Effect Next: Detached Binary: Roche vs Rotstar
Last update: 10/29/2018 9:20 a.m. (CET)