Atmospheres & Passbands

Setup

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

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


In [1]:
%matplotlib inline

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

And we'll add a single light curve dataset to expose all the passband-dependent options.


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


Out[3]:
<ParameterSet: 43 parameters | contexts: dataset, figure, compute, constraint>

Relevant Parameters

An 'atm' parameter exists for each of the components in the system (for each set of compute options) and defines which atmosphere table should be used.

By default, these are set to 'ck2004' (Castelli-Kurucz) but can be set to 'blackbody' as well as 'extern_atmx' and 'extern_planckint' (which are included primarily for direct comparison with PHOEBE legacy).


In [4]:
b['atm']


Out[4]:
<ParameterSet: 2 parameters | components: secondary, primary>

In [5]:
b['atm@primary']


Out[5]:
<Parameter: atm=ck2004 | keys: description, choices, value, visible_if, copy_for, advanced>

In [6]:
b['atm@primary'].description


Out[6]:
'Atmosphere table'

In [7]:
b['atm@primary'].choices


Out[7]:
['blackbody', 'ck2004', 'extern_atmx', 'extern_planckint', 'phoenix']

Note that if you change the value of 'atm' to anything other than 'ck2004', the corresponding 'ld_func' will need to be changed to something other than 'interp' (warnings and errors will be raised to remind you of this).


In [8]:
b['ld_func@primary']


Out[8]:
<ParameterSet: EMPTY>

In [9]:
b['atm@primary'] = 'blackbody'


Wed, 11 Dec 2019 13:17 BUNDLE       WARNING ld_mode='interp' not supported by atm='blackbody'.  Either change atm@primary@phoebe01 or ld_mode@primary@lc01.  If not addressed, this warning will continue to be raised and will throw an error at run_compute.

In [10]:
print(b.run_checks())


Run Checks Report: FAIL
ERROR: ld_mode='interp' not supported by atm='blackbody'.  Either change atm@primary@phoebe01 or ld_mode@primary@lc01. (3 affected parameters)

In [12]:
b['ld_mode@primary'] = 'manual'
b['ld_func@primary'] = 'logarithmic'

In [13]:
print(b.run_checks())


Run Checks Report: PASS

A 'passband' parameter exists for each passband-dependent-dataset (i.e. not meshes or orbits, but light curves and radial velocities). This parameter dictates which passband should be used for the computation of all intensities.


In [14]:
b['passband']


Out[14]:
<Parameter: passband=Johnson:V | keys: description, choices, value, visible_if, copy_for, advanced>

The available choices will include both locally installed passbands as well as passbands currently available from the online PHOEBE repository. If you choose an online-passband, it will be downloaded and installed locally as soon as required by b.run_compute.


In [15]:
print(b['passband'].choices)


['Cousins:Ic', 'LSST:r', 'Bolometric:900-40000', 'Kepler:mean', 'LSST:z', 'LSST:y3', 'Johnson:V', 'LSST:i', 'LSST:y4', 'LSST:u', 'Cousins:Rc', 'Johnson:U', 'Johnson:B', 'LSST:g']

To see your current locally-installed passbands, call phoebe.list_installed_passbands().


In [16]:
print(phoebe.list_installed_passbands())


['Johnson:V', 'Bolometric:900-40000']

These installed passbands can be in any of a number of directories, which can be accessed via phoebe.list_passband_directories().

The first entry is the global location - this is where passbands can be stored by a server-admin to be available to all PHOEBE-users on that machine.

The second entry is the local location - this is where individual users can store passbands and where PHOEBE will download and install passbands (by default).


In [17]:
print(phoebe.list_passband_directories())


['/home/kyle/.local/lib/python3.7/site-packages/phoebe/atmospheres/tables/passbands/', '/home/kyle/.phoebe/atmospheres/tables/passbands/']

To see the passbands available from the online repository, call phoebe.list_online_passbands().


In [18]:
print(phoebe.list_online_passbands())


['Cousins:Ic', 'Cousins:Rc', 'Johnson:B', 'Johnson:U', 'Johnson:V', 'Kepler:mean', 'LSST:g', 'LSST:i', 'LSST:r', 'LSST:u', 'LSST:y3', 'LSST:y4', 'LSST:z']

Lastly, to manually download and install one of these online passbands, you can do so explicitly via phoebe.download_passband or by visiting tables.phoebe-project.org. See also the tutorial on updating passbands.

Note that this isn't necessary unless you want to explicitly download passbands before needed by run_compute (perhaps if you're expecting to have unreliable network connection in the future and want to ensure you have all needed passbands).


In [20]:
phoebe.download_passband('Cousins:Rc')

In [21]:
print(phoebe.list_installed_passbands())


['Cousins:Rc', 'Johnson:V', 'Bolometric:900-40000']

In [ ]: