PHOEBE 2.0 Documentation

2.0 Docs

  • 1.0
  • 2.0a
  • ver: 2.0


Prev: Sun (single rotating star) Next: Complete Binary Animation
.

IPython Notebook | Python Script

Minimal Example to Produce a Synthetic Light Curve

Setup

%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()
WARNING: Constant u'Gravitational constant' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Gravitational constant' is already has a definition in the u'si' system
WARNING: Constant u'Solar mass' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Solar mass' is already has a definition in the u'si' system
WARNING: Constant u'Solar radius' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Solar radius' is already has a definition in the u'si' system
WARNING: Constant u'Solar luminosity' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Solar luminosity' is already has a definition in the u'si' system
WARNING: developer mode enabled, to disable 'rm ~/.phoebe_devel_enabled' and restart phoebe
/usr/local/lib/python2.7/dist-packages/astropy/units/quantity.py:732: FutureWarning: comparison to None will result in an elementwise object comparison in the future.
  return super(Quantity, self).__eq__(other)

Adding Datasets

Now we’ll create an empty lc dataset:

b.add_dataset('lc', times=np.linspace(0,1,201), dataset='mylc')
<ParameterSet: 15 parameters | contexts: compute, dataset>

Running Compute

Now we’ll compute synthetics at the times provided using the default options

b.run_compute(irrad_method='none')
<ParameterSet: 2 parameters | qualifiers: fluxes, times>

Plotting

Now we can simply plot the resulting synthetic light curve.

axs, artists = b['mylc@model'].plot()
../../_images/minimal_synthetic_11_0.png
axs, artists = b['mylc@model'].plot(x='phases')
../../_images/minimal_synthetic_12_0.png
Prev: Sun (single rotating star) Next: Complete Binary Animation
.
Last update: 06/07/2017 11:30 a.m. (CET)