Physics Model¶
Stars¶
beast.physicsmodel.stars.stellib Module¶
Stellib class
Intent to implement a generic module to manage stellar library from various sources.
The interpolation is implemented from the pegase.2 fortran converted algorithm. (this may not be pythonic though)
Classes¶
Stellib (*args, **kargs) 
Basic stellar library class 
CompositeStellib (osllist, *args, **kwargs) 
Generates an object from the union of multiple individual libraries 
Kurucz ([filename]) 
The stellar atmosphere models by Castelli and Kurucz 2004 or ATLAS9 
Tlusty ([filename]) 
Tlusty O and B stellar atmospheres 
BTSettl ([medres]) 
BTSettl Library 
Munari (*args, **kwargs) 
ATLAS9 stellar atmospheres providing higher res than Kurucz medium resolution (1 Ang/pix) in optical (250010500 Ang) 
Elodie (*args, **kwargs) 
Elodie 3.1 stellar library derived class 
BaSeL (*args, **kwargs) 
BaSeL 2.2 (This library is used in Pegase.2) 
Aringer (*args, **kwargs) 
Aringer C+M+K giants Library 
Class Inheritance Diagram¶
beast.physicsmodel.stars.isochrone Module¶
Isochrone class
Intent to implement a generic module to manage isochrone mining from various sources.
Classes¶
Isochrone ([name]) 

padova2010 () 

pegase () 

ezIsoch (source[, interp]) 
Trying to make something that is easy to manipulate This class is basically a proxy to a table (whatever format works best) and tries to keep things coherent. 
PadovaWeb ([Zref, modeltype, filterPMS, …]) 

MISTWeb ([Zref, rotation]) 
Class Inheritance Diagram¶
Dust¶
beast.physicsmodel.dust.extinction Module¶
Extinction Curves
Classes¶
ExtinctionLaw () 
Extinction Law Template Class 
Cardelli89 () 
Cardelli89 Milky Way R(V) dependent Extinction Law 
Fitzpatrick99 () 
Fitzpatrick99 Milky Way R(V) dependent Extinction Law 
Gordon03_SMCBar () 
Gordon03 SMCBar extinction curve 
Gordon16_RvFALaw () 
Gordon16 RvFA extinction law 
Generalized_RvFALaw ([ALaw, BLaw]) 
Generalized RvFA extinction law 
Generalized_DustExt ([curve]) 
Generalized extinction curve class to import classes from dust_extinction package. 
Class Inheritance Diagram¶
Weights¶
Priors are implemented as weights to allow for fast integration. Handling the grid spacing is done with grid weights allowing the priors values to be independent of the grid spacing.
beast.physicsmodel.prior_weights_stars Module¶
Prior Weights¶
The priors on age, mass, and metallicty are computed as weights to use in the posterior calculations.
Functions¶
compute_distance_prior_weights (dists, …) 
Computes the distance prior for the specified model 
compute_age_prior_weights (logages, …) 
Computes the age prior for the specified model 
compute_mass_prior_weights (masses, …) 
Compute the mass prior for the specificed model 
compute_metallicity_prior_weights (mets, …) 
Computes the metallicity prior for the specified model 
imf_kroupa (in_x) 
Compute a Kroupa IMF 
beast.physicsmodel.grid_weights_stars Module¶
Grid Weights¶
The use of a nonuniformly spaced grid complicates the marginalization step as the trick of summation instead of integration is used. But this trick only works when the grid is uniformly spaced in all dimensions.
If the grid is not uniformly spaced, weights can be used to correct for the nonuniform spacing.
Functions¶
compute_distance_grid_weights (dists) 
Computes the distance weights to set a uniform prior on linear distance 
compute_age_grid_weights (logages) 
Computes the age weights to set a uniform prior on linear SFR 
compute_mass_grid_weights (masses) 
Computes the mass weights to set a uniform prior on linear mass 
compute_metallicity_grid_weights (mets) 
Computes the metallicity weights to set a uniform prior on linear metallicity 
compute_bin_boundaries (tab) 
Computes the boundaries of bins 
beast.physicsmodel.grid_and_prior_weights Module¶
Grid and Prior Weights¶
The use of a nonuniformly spaced grid complicates the marginalization step as the trick of summation instead of integration is used. But this trick only works when the grid is uniformaly spaced in all dimensions.
If the grid is not uniformally spaced, weights can be used to correct for the nonuniform spacing.
Basically, we want the maginalization using these grid weights to provide flat priors on all the fit parameters. Nonflat priors will be implemented with prior weights.
Functions¶
compute_age_mass_metallicity_weights (_tgrid, …) 
Computes the agemassmetallicity grid and prior weights on the BEAST model spectra grid Grid and prior weight columns updated by multiplying by the agemassmetallicity weight. 
compute_distance_age_mass_metallicity_weights (_tgrid) 
Computes the distance and agemassmetallicity grid and prior weights on the BEAST model spectra grid 
beast.physicsmodel.prior_weights_dust Module¶
Dust Prior Weights¶
The priors on A(V), R(V), and f_A computed as weights to use in the posterior calculations.
Classes¶
PriorWeightsDust (av_vals, av_model, rv_vals, …) 
Compute the priors as weights given the input grid 
Class Inheritance Diagram¶
Grid¶
beast.physicsmodel.grid Module¶
SED/spectral grids
Classes¶
ModelGrid (*args, **kwargs) 
Generic class 
SEDGrid (*args, **kwargs) 
Generate a grid that the full observational model (SEDs). 
SpectralGrid (*args, **kwargs) 
Generate a grid that contains spectra. 
Class Inheritance Diagram¶
beast.physicsmodel.helpers.gridbackends Module¶
Backends to handle the model grids different ways¶
Multiple backends are available to reduce the memory footprint for a performance cost as small as possible.
Implemented Backends¶
 MemoryBackend:
 Load everything into memory. Can initiate from variables, a filename, CacheBackend, and DiskBackend.
 CacheBackend:
 Load data only at the first request. You can work using only seds or only model properties without the overhead of loading both. (works with FITS and HDF files). Offers also dropping part of the data.
 DiskBackend:
 Works directly with an h5py support, ie., on disk. Cache and reading are allowed through any way offered by h5py, which becomes very handy for very lowmemory tasks such as doing single star figures.
Classes¶
GridBackend (*args, **kwargs) 
How the content of a grid is handled. 
MemoryBackend (lamb[, seds, grid, cov_diag, …]) 
Instanciate a grid object that has no physical storage 
CacheBackend (fname, *args, **kwargs) 
Load content from a file only when needed 
DiskBackend (fname, *args, **kwargs) 
Reads the data from disk when it is accessed. 
Class Inheritance Diagram¶
beast.physicsmodel.creategrid Module¶
Create extinguished grid more segmented dealing with large grids with enough memory
All functions are now transformed into generators. As a result, any function allows computation of a grid in an arbitrary number of chunks. This offers the possibility to generate grids that cannot fit in memory.
Note
 dependencies have also been updated accordingly.
 likelihood computations need to be updated to allow computations even if the full grid does not fit in memory
Functions¶
gen_spectral_grid_from_stellib_given_points (…) 
Generator that reinterpolates a given stellar spectral library on to 
make_extinguished_grid (spec_grid, …[, …]) 
Extinguish spectra and extract an SEDGrid through given series of filters (all wavelengths in stellar SEDs and filter response functions are assumed to be in Angstroms) 
add_spectral_properties (specgrid[, …]) 
Addon spectral calculations to spectral grids to extract in the fitting routines 
calc_absflux_cov_matrices (specgrid, sedgrid, …) 
Calculate the absflux covariance matrices for each model Must be done on the full spectrum of each model to account for the changing combined spectral response due to the model SED and the filter response curve. 