Distance

Setup

Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).


In [1]:
#!pip install -I "phoebe>=2.3,<2.4"

As always, let's do imports and initialize a logger and a new bundle.


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

Relevant Parameters

The 'distance' parameter lives in the 'system' context and is simply the distance between the center of the coordinate system and the observer (at t0)


In [3]:
print(b.get_parameter(qualifier='distance', context='system'))


Parameter: distance@system
                       Qualifier: distance
                     Description: Distance to the system
                           Value: 1.0 m
                  Constrained by: 
                      Constrains: None
                      Related to: None


In [4]:
print(b.get_parameter(qualifier='t0', context='system'))


Parameter: t0@system
                       Qualifier: t0
                     Description: Time at which all values are provided
                           Value: 0.0 d
                  Constrained by: 
                      Constrains: t0_perpass@binary@component, t0_ref@binary@component, mean_anom@binary@component
                      Related to: t0_supconj@binary@component, period@binary@component, ecc@binary@component, per0@binary@component, dpdt@binary@component, dperdt@binary@component, t0_perpass@binary@component, t0_ref@binary@component, mean_anom@binary@component

Influence on Orbits (Positions)

The distance has absolutely NO effect on the synthetic orbit as the origin of the orbit's coordinate system is such that the barycenter of the system is at 0,0,0 at t0.

To demonstrate this, let's create an 'orb' dataset and compute models at both 1 m and 2 m and then plot the resulting synthetic models.


In [5]:
b.add_dataset('orb', times=np.linspace(0,3,101), dataset='orb01')


Thu, 17 Sep 2020 10:56 BUNDLE       WARNING orb dataset uses 'compute_times' instead of 'times', applying value sent as 'times' to 'compute_times'.
Out[5]:
<ParameterSet: 45 parameters | contexts: constraint, figure, compute, dataset>

In [6]:
b.set_value('distance', 1.0)

In [7]:
b.run_compute(model='dist1')


100%|██████████| 101/101 [00:00<00:00, 5426.29it/s]
Out[7]:
<ParameterSet: 15 parameters | components: primary, secondary>

In [8]:
b.set_value('distance', 2.0)

In [9]:
b.run_compute(model='dist2')


100%|██████████| 101/101 [00:00<00:00, 5728.45it/s]
Out[9]:
<ParameterSet: 15 parameters | components: primary, secondary>

In [10]:
afig, mplfig = b['orb01'].plot(y='ws', show=True, legend=True)


Influence on Light Curves (Fluxes)

Fluxes are, however, affected by distance exactly as you'd expect as inverse of distance squared.

To illustrate this, let's add an 'lc' dataset and compute synthetic fluxes at 1 and 2 m.


In [11]:
b.add_dataset('lc', times=np.linspace(0,1,101), dataset='lc01')


Out[11]:
<ParameterSet: 73 parameters | contexts: constraint, figure, compute, dataset>

To make things easier to compare, let's disable limb darkening


In [12]:
b.set_value_all('ld_mode', 'manual')
b.set_value_all('ld_func', 'logarithmic')
b.set_value_all('ld_coeffs', [0.,0.])

In [13]:
b.set_value('distance', 1.0)

In [14]:
b.run_compute(model='dist1', overwrite=True)


100%|██████████| 176/176 [00:01<00:00, 144.54it/s]
Out[14]:
<ParameterSet: 17 parameters | kinds: lc, orb>

In [15]:
b.set_value('distance', 2.0)

In [16]:
b.run_compute(model='dist2', overwrite=True)


100%|██████████| 176/176 [00:01<00:00, 149.70it/s]
Out[16]:
<ParameterSet: 17 parameters | kinds: lc, orb>

Since we doubled the distance from 1 to 2 m, we expect the entire light curve at 2 m to be divided by 4 (note the y-scales on the plots below).


In [17]:
afig, mplfig = b['lc01'].plot(show=True, legend=True)


Note that 'pblum' is defined such that a (spherical, non-eclipsed, non-limb darkened) star with a pblum of 4pi will contribute a flux of 1.0 at 1.0 m (the default distance).

For more information, see the pblum tutorial

Influence on Meshes (Intensities)

Distance does not affect the intensities stored in the mesh (including those in relative units). In other words, like third light, distance only scales the fluxes.

NOTE: this is different than pblums which DO affect the relative intensities. Again, see the pblum tutorial for more details.

To see this we can run both of our distances again and look at the values of the intensities in the mesh.


In [18]:
b.add_dataset('mesh', times=[0], dataset='mesh01', columns=['intensities@lc01', 'abs_intensities@lc01'])


Thu, 17 Sep 2020 10:56 BUNDLE       WARNING mesh dataset uses 'compute_times' instead of 'times', applying value sent as 'times' to 'compute_times'.
Out[18]:
<ParameterSet: 83 parameters | contexts: constraint, figure, compute, dataset>

In [19]:
b.set_value('distance', 1.0)

In [20]:
b.run_compute(model='dist1', overwrite=True)


100%|██████████| 176/176 [00:01<00:00, 148.78it/s]
Out[20]:
<ParameterSet: 31 parameters | kinds: lc, mesh, orb>

In [21]:
b.set_value('distance', 2.0)

In [22]:
b.run_compute(model='dist2', overwrite=True)


100%|██████████| 176/176 [00:01<00:00, 141.19it/s]
Out[22]:
<ParameterSet: 31 parameters | kinds: lc, mesh, orb>

In [23]:
print("dist1 abs_intensities: ", np.nanmean(b.get_value(qualifier='abs_intensities', component='primary', dataset='lc01', model='dist1')))
print("dist2 abs_intensities: ", np.nanmean(b.get_value(qualifier='abs_intensities', component='primary', dataset='lc01', model='dist2')))


dist1 abs_intensities:  42614840611958.38
dist2 abs_intensities:  42614840611958.38

In [24]:
print("dist1 intensities: ", np.nanmean(b.get_value(qualifier='intensities', component='primary', dataset='lc01', model='dist1')))
print("dist2 intensities: ", np.nanmean(b.get_value(qualifier='intensities', component='primary', dataset='lc01', model='dist2')))


dist1 intensities:  7.759827970638058e-12
dist2 intensities:  7.759827970638058e-12

In [ ]: