PHOEBE 2.0 Documentation

2.0 Docs

  • 1.0
  • 2.0a
  • ver: 2.0


phoebe.atmospheres package

Submodules

phoebe.atmospheres.passbands module

class phoebe.atmospheres.passbands.Passband(ptf=None, pbset='Johnson', pbname='V', effwl=5500.0, wlunits=Unit("Angstrom"), calibrated=False, reference='', version=1.0, comments='', oversampling=1, from_file=False)[source]

Passband class holds data and tools for passband-related computations, such as blackbody intensity, model atmosphere intensity, etc.

@ptf: passband transmission file: a 2-column file with wavelength in @wlunits
and transmission in arbitrary units

@pbset: name of the passband set (i.e. Johnson) @pbname: name of the passband name (i.e. V) @effwl: effective wavelength in @wlunits @wlunits: wavelength units from astropy.units used in @ptf and @effwl @calibrated: true if transmission is in true fractional light,

false if it is in relative proportions

@reference: passband transmission data reference (i.e. ADPS) @version: file version @comments: any additional comments about the passband @oversampling: the multiplicative factor of PTF dispersion to attain higher

integration accuracy
@from_file: a switch that instructs the class instance to skip all calculations
and load all data from the file passed to the Passband.load() method.

Step #1: initialize passband object

>>> pb = Passband(ptf='JOHNSON.V', pbset='Johnson', pbname='V', effwl=5500.0, wlunits=u.AA, calibrated=True, reference='ADPS', version=1.0, comments='')

Step #2: compute intensities for blackbody radiation:

>>> pb.compute_blackbody_response()

Step #3: compute Castelli & Kurucz (2004) intensities. To do this, the tables/ck2004 directory needs to be populated with non-filtered intensities available for download from %static%/ck2004.tar.

>>> atmdir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tables/ck2004'))
>>> pb.compute_ck2004_response(atmdir)

Step #4: – optional – import WD tables for comparison. This can only be done if the passband is in the list of supported passbands in WD. The WD index of the passband is passed to the import_wd_atmcof() function below as the last argument.

>>> from phoebe.atmospheres import atmcof
>>> atmdir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tables/wd'))
>>> atmcof.init(atmdir+'/atmcofplanck.dat', atmdir+'/atmcof.dat')
>>> pb.import_wd_atmcof(atmdir+'/atmcofplanck.dat', atmdir+'/atmcof.dat', 7)

Step #5: save the passband file:

>>> atmdir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tables/passbands'))
>>> pb.save(atmdir + '/johnson_v.ptf')

From now on you can use @pbset:@pbname as a passband qualifier, i.e. Johnson:V for the example above. Further details on supported model atmospheres are available by issuing:

>>> pb.content
save(archive)[source]
classmethod load(archive)[source]
compute_blackbody_response(Teffs=None)[source]

Computes blackbody intensities across the entire range of effective temperatures.

@Teffs: an array of effective temperatures. If None, a default array from ~300K to ~500000K with 97 steps is used. The default array is uniform in log10 scale.

Returns: n/a

compute_ck2004_response(path, verbose=False)[source]

Computes Castelli & Kurucz (2004) intensities across the entire range of model atmospheres.

@path: path to the directory containing ck2004 SEDs @verbose: switch to determine whether computing progress should be printed on screen

Returns: n/a

compute_ck2004_intensities(path, particular=None, verbose=False)[source]

Computes direction-dependent passband intensities using Castelli & Kurucz (2004) model atmospheres.

@path: path to the directory with SEDs @particular: particular file in @path to be processed; if None,

all files in the directory are processed.

@verbose: set to True to display progress in the terminal.

compute_ck2004_ldcoeffs(plot_diagnostics=False)[source]
compute_ck2004_ldints()[source]

Computes integrated limb darkening profiles for ck2004 atmospheres. These are used for intensity-to-flux transformations. The evaluated integral is:

ldint = 1/pi int_0^1 Imu mu dmu

interpolate_ck2004_ldcoeffs(Teff=5772.0, logg=4.43, abun=0.0, atm='ck2004', ld_func='power', photon_weighted=False)[source]

Interpolate the passband-stored table of LD model coefficients.

import_wd_atmcof(plfile, atmfile, wdidx, Nabun=19, Nlogg=11, Npb=25, Nints=4)[source]

Parses WD’s atmcof and reads in all Legendre polynomials for the given passband.

@plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat @wdidx: WD index of the passed passband. This can be automated

but it’s not a high priority.
@Nabun: number of metallicity nodes in atmcof.dat. For the 2003 version
the number of nodes is 19.
@Nlogg: number of logg nodes in atmcof.dat. For the 2003 version
the number of nodes is 11.
@Npb: number of passbands in atmcof.dat. For the 2003 version
the number of passbands is 25.
@Nints: number of temperature intervals (input lines) per entry.
For the 2003 version the number of lines is 4.
Inorm(Teff=5772.0, logg=4.43, abun=0.0, atm='ck2004', ldint=None, ld_func='interp', ld_coeffs=None, photon_weighted=False)[source]
@ldint: integral of the limb darkening function, int_0^1 mu L(mu) dmu.
Its general role is to convert intensity to flux. In this function, however, it is only needed for blackbody atmospheres because they are not limb-darkened (i.e. the blackbody intensity is the same irrespective of mu), so we need to divide by ldint to ascertain the correspondence between luminosity, effective temperature and fluxes once limb darkening correction is applied at flux integration time. If None, and if atm==’blackbody’, it will be computed from ld_func and ld_coeffs.
@ld_func: limb darkening function: linear, sqrt, log, quadratic,
power, interp
@ld_coeffs: limb darkening coefficients for the corresponding
limb darkening function.
Imu(Teff=5772.0, logg=4.43, abun=0.0, mu=1.0, atm='ck2004', ldint=None, ld_func='interp', ld_coeffs=None, photon_weighted=False)[source]
@ldint: integral of the limb darkening function, int_0^1 mu L(mu) dmu.
Its general role is to convert intensity to flux. In this function, however, it is only needed for blackbody atmospheres because they are not limb-darkened (i.e. the blackbody intensity is the same irrespective of mu), so we need to divide by ldint to ascertain the correspondence between luminosity, effective temperature and fluxes once limb darkening correction is applied at flux integration time. If None, and if atm==’blackbody’, it will be computed from ld_func and ld_coeffs.
@ld_func: limb darkening function: linear, sqrt, log, quadratic,
power, interp
@ld_coeffs: limb darkening coefficients for the corresponding
limb darkening function.
ldint(Teff=5772.0, logg=4.43, abun=0.0, atm='ck2004', ld_func='interp', ld_coeffs=None, photon_weighted=False)[source]
bindex(Teff=5772.0, logg=4.43, abun=0.0, mu=1.0, atm='ck2004', photon_weighted=False)[source]
phoebe.atmospheres.passbands.init_passband(fullpath)[source]
phoebe.atmospheres.passbands.init_passbands(refresh=False)[source]

This function should be called only once, at import time. It traverses the passbands directory and builds a lookup table of passband names qualified as ‘pbset:pbname’ and corresponding files and atmosphere content within.

phoebe.atmospheres.passbands.install_passband(fname, local=True)[source]

Install a passband from a local file. This simply copies the file into the install path - but beware that clearing the installation will clear the passband as well

If local=False, you must have permissions to access the installation directory

phoebe.atmospheres.passbands.uninstall_all_passbands(local=True)[source]

Uninstall all passbands, either globally or locally (need to call twice to delete ALL passbands)

If local=False, you must have permission to access the installation directory

phoebe.atmospheres.passbands.download_passband(passband, local=True)[source]

Download and install a given passband from the repository.

If local=False, you must have permission to access the installation directory

phoebe.atmospheres.passbands.list_passband_directories()[source]
phoebe.atmospheres.passbands.list_passbands(refresh=False)[source]
phoebe.atmospheres.passbands.list_installed_passbands(refresh=False)[source]
phoebe.atmospheres.passbands.list_online_passbands(refresh=False, full_dict=False)[source]
phoebe.atmospheres.passbands.get_passband(passband)[source]
phoebe.atmospheres.passbands.Inorm_bol_bb(Teff=5772.0, logg=4.43, abun=0.0, atm='blackbody', photon_weighted=False)[source]

@Teff: value or array of effective temperatures @logg: surface gravity; not used, for class compatibility only @abun: abundances; not used, for class compatibility only @atm: atmosphere model, must be blackbody, otherwise exception is raised @photon_weighted: intensity weighting scheme; must be False, otherwise exception is raised

Computes normal bolometric intensity using the Stefan-Boltzmann law, Inorm_bol_bb = 1/pi sigma T^4. If photon-weighted intensity is requested, Inorm_bol_bb is multiplied by a conversion factor that comes from integrating lambda/hc P(lambda) over all lambda.

Input parameters mimick the Passband class Inorm method for calling convenience.

Module contents

Last update: 06/07/2017 11:30 a.m. (CET)