PHOEBE 2.1 Documentation

2.1 Docs



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()

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.

afig, mplfig = b['mylc@model'].plot(show=True)
../../_images/minimal_synthetic_11_0.png
afig, mplfig = b['mylc@model'].plot(x='phases', show=True)
../../_images/minimal_synthetic_12_0.png
Prev: Sun (single rotating star) Next: Complete Binary Animation
.
Last update: 10/29/2018 9:20 a.m. (CET)