PHOEBE 2.1 Documentation

2.1 Docs

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

Dataset Parameters

Let’s create the and orb dataset and attach it to the Bundle

print b.filter(kind='orb')
ParameterSet: 2 parameters
     times@primary@orb01@dataset: [] d
   times@secondary@orb01@dataset: [] d


print b['times']
ParameterSet: 2 parameters
     times@primary@orb01@dataset: [] d
   times@secondary@orb01@dataset: [] d

Compute Options

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

print b['compute']
ParameterSet: 15 parameters
  dynamics_method@phoebe01@co...: keplerian
           ltte@phoebe01@compute: False
   irrad_method@phoebe01@compute: wilson
  boosting_method@phoebe01@co...: none
  eclipse_method@phoebe01@com...: native
  horizon_method@phoebe01@com...: boolean
  mesh_method@primary@phoebe0...: marching
  mesh_method@secondary@phoeb...: marching
  ntriangles@primary@phoebe01...: 1500
  ntriangles@secondary@phoebe...: 1500
  distortion_method@primary@p...: roche
  distortion_method@secondary...: roche
    atm@primary@phoebe01@compute: ck2004
  atm@secondary@phoebe01@compute: ck2004
  enabled@orb01@phoebe01@compute: True


print b['dynamics_method']
Parameter: dynamics_method@phoebe01@compute
                       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). * nbody: Use an n-body integrator to determine positions. Here the initial conditions (positions and velocities) are still defined by the orbit’s Keplerian parameters at 't0@system‘. Closed orbits and orbital stability are not guaranteed and ejections can occur.


print b['ltte']
Parameter: ltte@phoebe01@compute
                       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.set_value_all('times', np.linspace(0,3,201))
<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['us@primary@orb01@orb@model']
Parameter: us@primary@latest@model
                       Qualifier: us
                     Description: U 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['vus@primary@orb01@orb@model']
Parameter: vus@primary@latest@model
                       Qualifier: vus
                     Description: U velocity
                           Value: [-134.07073898 -133.4757283  -131.6959776  ... -131.6959776
 -133.4757283  -134.07073898] km / s
                  Constrained by:
                      Constrains: None
                      Related to: None


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

afig, mplfig = b['orb@model'].plot(show=True)

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

afig, mplfig = b['orb@model'].plot(x='times', y='vus', show=True)

We can also plot the orbit in 3D.

afig, mplfig = b['orb@model'].plot(projection='3d', xlim=(-4,4), ylim=(-4,4), zlim=(-4,4), show=True)
Prev: PHOEBE Logic for Computing Observables Next: ‘mesh’ Datasets and Options
Last update: 10/29/2018 9:20 a.m. (CET)