PHOEBE 2.1 Documentation

2.1 Docs



IPython Notebook | Python Script

‘rv’ Datasets and Options

Setup

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 add an RV dataset to the Bundle.

b.add_dataset('rv')
print b.filter(kind='rv')
ParameterSet: 2 parameters
      times@primary@rv01@dataset: [] d
    times@secondary@rv01@dataset: [] d
print b.filter(kind='rv_dep')
ParameterSet: 4 parameters
           passband@rv01@dataset: Johnson:V
   intens_weighting@rv01@dataset: energy
    ld_func@primary@rv01@dataset: interp
  ld_func@secondary@rv01@dataset: interp

For information on these passband-dependent parameters, see the section on the lc dataset (these are used only to compute fluxes when rv_method==’flux-weighted’)

times

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

rvs

print b['rvs']
ParameterSet: 0 parameters
NO PARAMETERS

sigmas

print b['sigmas']
ParameterSet: 0 parameters
NO PARAMETERS

Compute Options

Let’s look at the compute options (for the default PHOEBE 2 backend) that relate to the RV dataset.

Other compute options are covered elsewhere: * parameters related to dynamics are explained in the section on the orb dataset * parameters related to meshing, eclipse detection, and subdivision (used if rv_method==’flux-weighted’) are explained in the section on the mesh dataset * parameters related to computing fluxes (used if rv_method==’flux-weighted’) are explained in the section on the lc dataset

print b['compute']
ParameterSet: 19 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@rv01@phoebe01@compute: True
  rv_method@primary@phoebe01@...: flux-weighted
  rv_method@secondary@phoebe0...: flux-weighted
  rv_grav@primary@phoebe01@co...: False
  rv_grav@secondary@phoebe01@...: False

rv_method

print b['rv_method']
ParameterSet: 2 parameters
  rv_method@primary@phoebe01@...: flux-weighted
  rv_method@secondary@phoebe0...: flux-weighted

If rv_method is set to ‘dynamical’ then the computed radial velocities are simply the z-velocities of the centers of mass of each component. In this case, only the dynamical options are relevant. For more details on these, see the section on the orb dataset.

If rv_method is set to ‘flux-weighted’ then radial velocities are determined by the z-velocity of each visible surface element of the mesh, weighted by their respective intensities. Since the stars are placed in their orbits by the dynamic options, the section on the orb dataset is still applicable. So are the meshing options described in mesh dataset and the options for computing fluxes in lc dataset.

rv_grav

print b['rv_grav']
ParameterSet: 2 parameters
  rv_grav@primary@phoebe01@co...: False
  rv_grav@secondary@phoebe01@...: False

See the Gravitational Redshift Example Script for more details on the influence this parameter has on radial velocities.

Synthetics

b.set_value_all('times', np.linspace(0,1,101))
b.run_compute(irrad_method='none')
<ParameterSet: 4 parameters | components: primary, secondary>
b['rv@model'].twigs
['times@primary@rv01@phoebe01@latest@rv@model',
 'rvs@primary@rv01@phoebe01@latest@rv@model',
 'times@secondary@rv01@phoebe01@latest@rv@model',
 'rvs@secondary@rv01@phoebe01@latest@rv@model']
print b['times@primary@rv@model']
Parameter: times@primary@latest@model
                       Qualifier: times
                     Description: Observed times
                           Value: [0.   0.01 0.02 ... 0.98 0.99 1.  ] d
                  Constrained by:
                      Constrains: None
                      Related to: None
print b['rvs@primary@rv@model']
Parameter: rvs@primary@latest@model
                       Qualifier: rvs
                     Description: Observed radial velocity
                           Value: [  0.6384468  -40.16177632 -40.16909745 ...  40.17432856
  40.15661595   0.6384468 ] km / s
                  Constrained by:
                      Constrains: None
                      Related to: None
                 Only visible if: times:<notempty>

Plotting

By default, RV datasets plot as ‘rvs’ vs ‘times’.

afig, mplfig = b['rv@model'].plot(show=True)
../../_images/RV_30_0.png

Since these are the only two columns available in the synthetic model, the only other options is to plot in phase instead of time.

afig, mplfig = b['rv@model'].plot(x='phases', show=True)
../../_images/RV_32_0.png

In system hierarchies where there may be multiple periods, it is also possible to determine whose period to use for phasing.

b['period'].components
['binary', 'primary', 'secondary']
afig, mplfig = b['rv@model'].plot(x='phases:binary', show=True)
../../_images/RV_35_0.png

Mesh Fields

By adding a mesh dataset and setting the columns parameter, radial velocities per-element quantities can be exposed and plotted. Since the radial velocities are flux-weighted, the flux-related quantities are also included. For a description of these, see the section on the lc dataset.

Let’s add a mesh at the first time of the rv dataset and re-call run_compute

b.add_dataset('mesh', times=[0], dataset='mesh01')
<ParameterSet: 4 parameters | contexts: compute, dataset>
print b['columns'].choices
['pot', 'rpole', 'volume', 'xs', 'ys', 'zs', 'vxs', 'vys', 'vzs', 'nxs', 'nys', 'nzs', 'us', 'vs', 'ws', 'vus', 'vvs', 'vws', 'nus', 'nvs', 'nws', 'areas', 'loggs', 'teffs', 'rprojs', 'mus', 'visibilities', 'visible_centroids', 'rs', 'intensities@rv01', 'normal_intensities@rv01', 'abs_intensities@rv01', 'abs_normal_intensities@rv01', 'boost_factors@rv01', 'ldint@rv01', 'pblum@rv01', 'abs_pblum@rv01', 'ptfarea@rv01', 'rvs@rv01']
b['columns'] = ['rvs@rv01']
b.run_compute(irrad_method='none')
Thu, 04 Oct 2018 15:12 BUNDLE       WARNING overwriting model: latest
<ParameterSet: 12 parameters | kinds: rv, mesh>
print b['model'].datasets
['mesh01', 'rv01']

These new columns are stored with the rv’s dataset tag, but with the mesh model-kind.

b.filter(dataset='rv01', kind='mesh', context='model').twigs
['00.000000@rvs@primary@rv01@phoebe01@latest@mesh@model',
 '00.000000@rvs@secondary@rv01@phoebe01@latest@mesh@model']

Any of these columns are then available to use as edge or facecolors when plotting the mesh (see the section on the MESH dataset).

afig, mplfig = b['mesh01@model'].plot(fc='rvs', ec='None', show=True)
../../_images/RV_45_0.png

rvs

print b['rvs@primary@rv01@mesh@model']
Parameter: 00.000000@rvs@primary@latest@model
                       Qualifier: rvs
                     Description: Per-element value of rvs for rv01 dataset
                           Value: [-3.51428103e+00 -1.88225026e-05  3.51419791e+00 ...
  3.84090451e+01  3.72780179e+01  3.84944182e+01] km / s
                  Constrained by:
                      Constrains: None
                      Related to: None
Prev: ‘lc’ Datasets and Options Next: ‘lp’ (Line Profile) Datasets and Options
.
Last update: 10/29/2018 9:20 a.m. (CET)