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¶

Basic stellar library class 

Generates an object from the union of multiple individual libraries 

The stellar atmosphere models by Castelli and Kurucz 2004 or ATLAS9 

Tlusty O and B stellar atmospheres 

BTSettl Library 

ATLAS9 stellar atmospheres providing higher res than Kurucz medium resolution (1 Ang/pix) in optical (250010500 Ang) 

Elodie 3.1 stellar library derived class 

BaSeL 2.2 (This library is used in Pegase.2) 

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¶





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. 



Class Inheritance Diagram¶
Dust¶
beast.physicsmodel.dust.extinction Module¶
Extinction Curves
Classes¶
Extinction Law Template Class 

Cardelli89 Milky Way R(V) dependent Extinction Law 

Fitzpatrick99 Milky Way R(V) dependent Extinction Law 

Gordon03 SMCBar extinction curve 

Gordon16 RvFA extinction law 


Generalized RvFA extinction law 

Generalized extinction curve class to import classes from dust_extinction package. 
Class Inheritance Diagram¶
beast.physicsmodel.dust.extinction_extension Module¶
Classes¶

dust_extinction.parameter_averages.F19 model extended to shorter wavelengths using the dust_extinction.grain_models.D03 models. 

dust_extinction.averages.G03_SMCBar model extended to shorter wavelengths using the dust_extinction.grain_models.WD01 SMCBar model. 
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.priormodel Module¶
Classes¶

Compute the priors as weights given the input grid 

Prior model for dust parameters with specific allowed models. 

Prior model for age parameter with specific allowed models. 

Prior model for mass parameter with specific allowed models. 

Prior model for metallicity parameter with specific allowed models. 

Prior model for distance parameter with specific allowed models. 
Class Inheritance Diagram¶
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¶
Computes the distance weights to set a uniform prior on linear distance 


Computes the age weights to set a uniform prior on linear SFR 

Computes the mass weights to set a uniform prior on linear mass 
Computes the metallicity weights to set a uniform prior on linear metallicity 

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¶

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. 
Computes the distance and agemassmetallicity grid and prior weights on the BEAST model spectra grid 
Grid¶
beast.physicsmodel.grid Module¶
SED/spectral grids
Classes¶

Generic class 

Generate a grid that the full observational model (SEDs). 

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¶

How the content of a grid is handled. 

Instanciate a grid object that has no physical storage 

Load content from a file only when needed 

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¶
Generator that reinterpolates a given stellar spectral library on to 


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) 

Addon spectral calculations to spectral grids to extract in the fitting routines 

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. 