Atmospheres & Passbands

Setup

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

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


/usr/lib/python2.7/dist-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the same functionality instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)

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: 15 parameters | contexts: compute, dataset>

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: primary, secondary>

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


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

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


Out[6]:
'Atmosphere table'

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


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

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]:
<Parameter: ld_func=interp | keys: description, choices, value, visible_if, copy_for>

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


Fri, 01 Feb 2019 14:04 PARAMETERS   WARNING ld_func='interp' only supported by atm='ck2004'

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


(False, "ld_func='interp' only supported by atm='ck2004'")

In [11]:
b['ld_func@primary'] = 'logarithmic'

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


(True, '')

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 [13]:
b['passband']


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

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 [14]:
print(b['passband'].choices)


[u'STEREO:HI1A-noQE', u'Cousins:R', u'Stromgren:b', u'Brite:B', u'STEREO:HI1B-QE', u'Stromgren:v', u'Hipparcos:Hp', u'Stromgren:u', u'Brite:R', u'Stromgren:y', u'Johnson:B', u'Gaia:RP', u'STEREO:HI1B-noQE', u'Tycho:VT', u'Bolometric:900-40000', u'Johnson:R', u'Johnson:V', u'Johnson:U', u'Gaia:RVS', u'Kepler:mean', u'Gaia:G', u'Tycho:BT', u'Spitzer:5.8um', u'Gaia:BP', u'Spitzer:4.5um', u'KELT:R', u'LSST:i', u'LSST:g', u'TESS:default', u'Spitzer:3.6um', u'Cousins:I', u'LSST:z', u'STEREO:HI1A-QE', u'LSST:y', u'LSST:u', u'LSST:r', u'Spitzer:8.0um']

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


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


[u'Johnson:V']

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 [16]:
print(phoebe.list_passband_directories())


('/home/kyle/.local/lib/python2.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 [17]:
print(phoebe.list_online_passbands())


[u'STEREO:HI1A-noQE', u'Spitzer:3.6um', u'Stromgren:b', u'Brite:B', u'STEREO:HI1B-QE', u'Stromgren:v', u'Hipparcos:Hp', u'Stromgren:u', u'Brite:R', u'Stromgren:y', u'Johnson:B', u'Gaia:RP', u'STEREO:HI1B-noQE', u'Tycho:VT', u'Bolometric:900-40000', u'Johnson:R', u'Johnson:V', u'Johnson:U', u'Gaia:RVS', u'Kepler:mean', u'LSST:i', u'Gaia:G', u'Tycho:BT', u'Spitzer:5.8um', u'Spitzer:4.5um', u'KELT:R', u'Gaia:BP', u'LSST:g', u'TESS:default', u'Cousins:R', u'Cousins:I', u'LSST:z', u'STEREO:HI1A-QE', u'LSST:y', u'LSST:u', u'LSST:r', u'Spitzer:8.0um']

Lastly, to manually download and install one of these online passbands, you can do so explicitly via phoebe.download_passband.

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 [18]:
phoebe.download_passband('Cousins:R')

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


[u'Cousins:R', u'Johnson:V']

In [ ]: