PHOEBE 2.1 Documentation

2.1 Docs



IPython Notebook | Python Script

Binary with Spots

Setup

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

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

logger = phoebe.logger()

b = phoebe.default_binary()

Adding Spots

Let’s add one spot to each of our stars in the binary.

A spot is a feature, and needs to be attached directly to a component upon creation. Providing a tag for ‘feature’ is entirely optional - if one is not provided it will be created automatically.

b.add_feature('spot', component='primary', feature='spot01')
<ParameterSet: 4 parameters | qualifiers: colat, radius, long, relteff>

As a shortcut, we can also call add_spot directly.

b.add_spot(component='secondary', feature='spot02')
<ParameterSet: 4 parameters | qualifiers: colat, radius, long, relteff>

Spot Parameters

A spot is defined by the colatitude and longitude of its center, its angular radius, and the ratio of temperature of the spot to the local intrinsic value.

print b['spot01']
ParameterSet: 4 parameters
            colat@spot01@feature: 0.0 deg
             long@spot01@feature: 0.0 deg
           radius@spot01@feature: 1.0 deg
          relteff@spot01@feature: 1.0
b.set_value(qualifier='relteff', feature='spot01', value=0.9)
b.set_value(qualifier='radius', feature='spot01', value=30)
b.set_value(qualifier='colat', feature='spot01', value=45)
b.set_value(qualifier='long', feature='spot01', value=90)

To see the spot, add a mesh dataset and plot it.

b.add_dataset('mesh', times=[0,0.25,0.5,0.75,1.0], columns=['teffs'])
<ParameterSet: 4 parameters | contexts: compute, dataset>
b.run_compute()
<ParameterSet: 32 parameters | components: primary, secondary>
afig, mplfig = b.filter(component='primary', time=0.75).plot(fc='teffs', show=True)
../../_images/binary_spots_20_0.png

Spot Corotation

The positions (colat, long) of a spot are defined at t0 (note: t0@system, not necessarily t0_perpass or t0_supconj). If the stars are not synchronous, then the spots will corotate with the star. To illustrate this, let’s set the syncpar > 1 and plot the mesh at three different phases from above.

b.set_value('syncpar@primary', 1.5)
b.run_compute(irrad_method='none')
Mon, 15 Oct 2018 17:20 BUNDLE       WARNING overwriting model: latest
<ParameterSet: 32 parameters | components: primary, secondary>

At time=t0=0, we can see that the spot is where defined: 45 degrees south of the north pole and 90 degree longitude (where longitude of 0 is defined as pointing towards the companion star at t0).

print "t0 = {}".format(b.get_value('t0', context='system'))
t0 = 0.0
afig, mplfig = b.plot(time=0, y='ws', fc='teffs', ec='None', show=True)
../../_images/binary_spots_26_0.png

At a later time, the spot is still technically at the same coordinates, but longitude of 0 no longer corresponds to pointing to the companion star. The coordinate system has rotated along with the asyncronous rotation of the star.

afig, mplfig = b.plot(time=0.25, y='ws', fc='teffs', facecmap='YlOrRd', ec='None', show=True)
../../_images/binary_spots_28_0.png
afig, mplfig = b.plot(time=0.5, y='ws', fc='teffs', facecmap='YlOrRd', ec='None', show=True)
../../_images/binary_spots_29_0.png
ax, artists = b.plot(time=0.75, y='ws', fc='teffs', facecmap='YlOrRd', ec='None', show=True)
../../_images/binary_spots_30_0.png

Since the syncpar was set to 1.5, one full orbit later the star (and the spot) has made an extra half-rotation.

ax, artists = b.plot(time=1.0, y='ws', fc='teffs', facecmap='YlOrRd', ec='None', show=True)
../../_images/binary_spots_32_0.png
Prev: Detached Binary: Roche vs Rotstar Next: Minimal Contact Binary System
.
Last update: 10/29/2018 9:20 a.m. (CET)