Minimal Example to Produce a Synthetic Light Curve

Setup

Let's first make sure we have the latest version of PHOEBE 2.0 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.0,<2.1"

In [1]:
%matplotlib inline

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


In [2]:
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:


In [3]:
b.add_dataset('lc', times=np.linspace(0,1,201), dataset='mylc')


Out[3]:
<ParameterSet: 15 parameters | contexts: compute, dataset>

Running Compute

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


In [4]:
b.run_compute(irrad_method='none')


Out[4]:
<ParameterSet: 2 parameters | qualifiers: fluxes, times>

Plotting

Now we can simply plot the resulting synthetic light curve.


In [5]:
axs, artists = b['mylc@model'].plot()



In [6]:
axs, artists = b['mylc@model'].plot(x='phases')