PHOEBE 2.0 Documentation

2.0 Docs

  • 1.0
  • ver: 2.0

IPython Notebook | Python Script

‘orb’ Datasets and Options


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

Dataset Parameters

Let’s create the ParameterSet which would be added to the Bundle when calling add_dataset. Later we’ll call add_dataset, which will create and attach this ParameterSet for us.

ps, constraints = phoebe.dataset.orb()
print ps
ParameterSet: 1 parameters
                  times@_default: [] d


print ps['times']
Parameter: times@_default
                       Qualifier: times
                     Description: Observed times
                           Value: [] d
                  Constrained by:
                      Constrains: None
                      Related to: None

Compute Options

Let’s look at the compute options (for the default PHOEBE 2 backend) that relate to dynamics and the ORB dataset

ps_compute = phoebe.compute.phoebe()
print ps_compute
ParameterSet: 19 parameters
                enabled@_default: True
                 dynamics_method: keplerian
                            ltte: False
                    irrad_method: wilson
                 boosting_method: none
                       protomesh: False
                          pbmesh: False
                         horizon: False
            mesh_method@_default: marching
             ntriangles@_default: 1000
      distortion_method@_default: roche
                  eclipse_method: native
                  horizon_method: boolean
                    atm@_default: ck2004
              lc_method@_default: numerical
             fti_method@_default: none
         fti_oversample@_default: 5
     rv_method@_default@_default: flux-weighted
       rv_grav@_default@_default: False


print ps_compute['dynamics_method']
Parameter: dynamics_method
                       Qualifier: dynamics_method
                     Description: Which method to use to determine the dynamics of components
                           Value: keplerian
                         Choices: keplerian

The ‘dynamics_method’ parameter controls how stars and components are placed in the coordinate system as a function of time and has several choices: * keplerian (default): Use Kepler’s laws to determine positions. If the system has more than two components, then each orbit is treated independently and nested (ie there are no dynamical/tidal effects - the inner orbit is treated as a single point mass in the outer orbit). * more coming soon


print ps_compute['ltte']
Parameter: ltte
                       Qualifier: ltte
                     Description: Correct for light travel time effects
                           Value: False

The ‘ltte’ parameter sets whether light travel time effects (Roemer delay) are included. If set to False, the positions and velocities are returned as they actually are for that given object at that given time. If set to True, they are instead returned as they were or will be when their light reaches the origin of the coordinate system.

See the Systemic Velocity Example Script for an example of how ‘ltte’ and ‘vgamma’ (systemic velocity) interplay.


b.add_dataset('orb', times=np.linspace(0,3,201))
<ParameterSet: 3 parameters | contexts: compute, dataset>
<ParameterSet: 14 parameters | components: primary, secondary>
print b['times@primary@orb01@orb@model']
Parameter: times@primary@latest@model
                       Qualifier: times
                     Description: Synthetic times
                           Value: [ 0.     0.015  0.03  ...,  2.97   2.985  3.   ] d
                  Constrained by:
                      Constrains: None
                      Related to: None
print b['xs@primary@orb01@orb@model']
Parameter: xs@primary@latest@model
                       Qualifier: xs
                     Description: X position
                           Value: [  1.62265701e-16  -2.49387030e-01  -4.96560484e-01 ...,
   4.96560484e-01   2.49387030e-01  -2.19140711e-15] solRad
                  Constrained by:
                      Constrains: None
                      Related to: None
print b['vxs@primary@orb01@orb@model']
Parameter: vxs@primary@latest@model
                       Qualifier: vxs
                     Description: X velocity
                           Value: [-16.65044106 -16.57654582 -16.35551598 ..., -16.35551598
 -16.57654582 -16.65044106] solRad / d
                  Constrained by:
                      Constrains: None
                      Related to: None


By default, orb datasets plot as ‘ys’ vx ‘xs’ (plane of sky). Notice the y-scale here with inclination set to 90.

axs, artists = b['orb@model'].plot()

As always, you have access to any of the arrays for either axes, so if you want to plot ‘vxs’ vs ‘times’

axs, artists = b['orb@model'].plot(x='times', y='vxs')

3d axes are not yet supported for orbits, but hopefully will be soon.

Once they are supported, they will default to x, y, and z positions plotted on their respective axes.

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

axs, artists = b['orb@model'].plot(xlim=(-4,4), ylim=(-4,4), zlim=(-4,4))
Prev: PHOEBE Logic for Computing Observables Next: ‘mesh’ Datasets and Options
Last update: 06/07/2017 11:30 a.m. (CET)