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

BT-Settl Library

Munari(*args, **kwargs)

ATLAS9 stellar atmospheres providing higher res than Kurucz medium resolution (1 Ang/pix) in optical (2500-10500 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

digraph inheritance232726a6ad { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Aringer" [URL="api/beast.physicsmodel.stars.stellib.Aringer.html#beast.physicsmodel.stars.stellib.Aringer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Aringer C+M+K giants Library"]; "Stellib" -> "Aringer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BTSettl" [URL="api/beast.physicsmodel.stars.stellib.BTSettl.html#beast.physicsmodel.stars.stellib.BTSettl",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="BT-Settl Library"]; "Stellib" -> "BTSettl" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaSeL" [URL="api/beast.physicsmodel.stars.stellib.BaSeL.html#beast.physicsmodel.stars.stellib.BaSeL",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="BaSeL 2.2 (This library is used in Pegase.2)"]; "Stellib" -> "BaSeL" [arrowsize=0.5,style="setlinewidth(0.5)"]; "CompositeStellib" [URL="api/beast.physicsmodel.stars.stellib.CompositeStellib.html#beast.physicsmodel.stars.stellib.CompositeStellib",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generates an object from the union of multiple individual libraries"]; "Stellib" -> "CompositeStellib" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Elodie" [URL="api/beast.physicsmodel.stars.stellib.Elodie.html#beast.physicsmodel.stars.stellib.Elodie",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Elodie 3.1 stellar library derived class"]; "Stellib" -> "Elodie" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Kurucz" [URL="api/beast.physicsmodel.stars.stellib.Kurucz.html#beast.physicsmodel.stars.stellib.Kurucz",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The stellar atmosphere models by Castelli and Kurucz 2004 or ATLAS9"]; "Stellib" -> "Kurucz" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Munari" [URL="api/beast.physicsmodel.stars.stellib.Munari.html#beast.physicsmodel.stars.stellib.Munari",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="ATLAS9 stellar atmospheres providing higher res than Kurucz"]; "Stellib" -> "Munari" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Stellib" [URL="api/beast.physicsmodel.stars.stellib.Stellib.html#beast.physicsmodel.stars.stellib.Stellib",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Basic stellar library class"]; "Tlusty" [URL="api/beast.physicsmodel.stars.stellib.Tlusty.html#beast.physicsmodel.stars.stellib.Tlusty",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Tlusty O and B stellar atmospheres"]; "Stellib" -> "Tlusty" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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

digraph inheritance81c25fb531 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Isochrone" [URL="api/beast.physicsmodel.stars.isochrone.Isochrone.html#beast.physicsmodel.stars.isochrone.Isochrone",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "MISTWeb" [URL="api/beast.physicsmodel.stars.isochrone.MISTWeb.html#beast.physicsmodel.stars.isochrone.MISTWeb",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Isochrone" -> "MISTWeb" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PadovaWeb" [URL="api/beast.physicsmodel.stars.isochrone.PadovaWeb.html#beast.physicsmodel.stars.isochrone.PadovaWeb",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Isochrone" -> "PadovaWeb" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ezIsoch" [URL="api/beast.physicsmodel.stars.isochrone.ezIsoch.html#beast.physicsmodel.stars.isochrone.ezIsoch",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Trying to make something that is easy to manipulate"]; "Isochrone" -> "ezIsoch" [arrowsize=0.5,style="setlinewidth(0.5)"]; "padova2010" [URL="api/beast.physicsmodel.stars.isochrone.padova2010.html#beast.physicsmodel.stars.isochrone.padova2010",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Isochrone" -> "padova2010" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pegase" [URL="api/beast.physicsmodel.stars.isochrone.pegase.html#beast.physicsmodel.stars.isochrone.pegase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Isochrone" -> "pegase" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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

digraph inheritance98b2aaa625 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Cardelli89" [URL="api/beast.physicsmodel.dust.extinction.Cardelli89.html#beast.physicsmodel.dust.extinction.Cardelli89",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Cardelli89 Milky Way R(V) dependent Extinction Law"]; "ExtinctionLaw" -> "Cardelli89" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ExtinctionLaw" [URL="api/beast.physicsmodel.dust.extinction.ExtinctionLaw.html#beast.physicsmodel.dust.extinction.ExtinctionLaw",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Extinction Law Template Class"]; "Fitzpatrick99" [URL="api/beast.physicsmodel.dust.extinction.Fitzpatrick99.html#beast.physicsmodel.dust.extinction.Fitzpatrick99",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Fitzpatrick99 Milky Way R(V) dependent Extinction Law"]; "ExtinctionLaw" -> "Fitzpatrick99" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Generalized_DustExt" [URL="api/beast.physicsmodel.dust.extinction.Generalized_DustExt.html#beast.physicsmodel.dust.extinction.Generalized_DustExt",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generalized extinction curve class to import classes from"]; "ExtinctionLaw" -> "Generalized_DustExt" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Generalized_RvFALaw" [URL="api/beast.physicsmodel.dust.extinction.Generalized_RvFALaw.html#beast.physicsmodel.dust.extinction.Generalized_RvFALaw",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generalized RvFA extinction law"]; "Gordon16_RvFALaw" -> "Generalized_RvFALaw" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Gordon03_SMCBar" [URL="api/beast.physicsmodel.dust.extinction.Gordon03_SMCBar.html#beast.physicsmodel.dust.extinction.Gordon03_SMCBar",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Gordon03 SMCBar extinction curve"]; "ExtinctionLaw" -> "Gordon03_SMCBar" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Gordon16_RvFALaw" [URL="api/beast.physicsmodel.dust.extinction.Gordon16_RvFALaw.html#beast.physicsmodel.dust.extinction.Gordon16_RvFALaw",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Gordon16 RvFA extinction law"]; "ExtinctionLaw" -> "Gordon16_RvFALaw" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

beast.physicsmodel.dust.extinction_extension Module

Classes

F19_D03_extension([Rv])

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

G03_SMCBar_WD01_extension(*args[, meta, name])

dust_extinction.averages.G03_SMCBar model extended to shorter wavelengths using the dust_extinction.grain_models.WD01 SMCBar model.

Class Inheritance Diagram

digraph inheritance20efd95055 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseExtModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Base Extinction Model. Do not use."]; "Model" -> "BaseExtModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseExtRvModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Base Extinction R(V)-dependent Model. Do not use."]; "BaseExtModel" -> "BaseExtRvModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "F19" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Fitzpatrick et al (2019) extinction model calculation"]; "BaseExtRvModel" -> "F19" [arrowsize=0.5,style="setlinewidth(0.5)"]; "F19_D03_extension" [URL="api/beast.physicsmodel.dust.extinction_extension.F19_D03_extension.html#beast.physicsmodel.dust.extinction_extension.F19_D03_extension",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="dust_extinction.parameter_averages.F19 model extended to shorter"]; "F19" -> "F19_D03_extension" [arrowsize=0.5,style="setlinewidth(0.5)"]; "G03_SMCBar" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Gordon et al (2003) SMCBar Average Extinction Curve"]; "BaseExtModel" -> "G03_SMCBar" [arrowsize=0.5,style="setlinewidth(0.5)"]; "G03_SMCBar_WD01_extension" [URL="api/beast.physicsmodel.dust.extinction_extension.G03_SMCBar_WD01_extension.html#beast.physicsmodel.dust.extinction_extension.G03_SMCBar_WD01_extension",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="dust_extinction.averages.G03_SMCBar model extended to shorter"]; "G03_SMCBar" -> "G03_SMCBar_WD01_extension" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Model" [URL="https://docs.astropy.org/en/stable/api/astropy.modeling.Model.html#astropy.modeling.Model",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all models."]; }

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

PriorModel(model[, allowed_models])

Compute the priors as weights given the input grid

PriorDustModel(model)

Prior model for dust parameters with specific allowed models.

PriorAgeModel(model)

Prior model for age parameter with specific allowed models.

PriorMassModel(model)

Prior model for mass parameter with specific allowed models.

PriorMetallicityModel(model)

Prior model for metallicity parameter with specific allowed models.

PriorDistanceModel(model)

Prior model for distance parameter with specific allowed models.

Class Inheritance Diagram

digraph inheritance9ac603ffd8 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "PriorAgeModel" [URL="api/beast.physicsmodel.priormodel.PriorAgeModel.html#beast.physicsmodel.priormodel.PriorAgeModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Prior model for age parameter with specific allowed models."]; "PriorModel" -> "PriorAgeModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PriorDistanceModel" [URL="api/beast.physicsmodel.priormodel.PriorDistanceModel.html#beast.physicsmodel.priormodel.PriorDistanceModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Prior model for distance parameter with specific allowed models."]; "PriorModel" -> "PriorDistanceModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PriorDustModel" [URL="api/beast.physicsmodel.priormodel.PriorDustModel.html#beast.physicsmodel.priormodel.PriorDustModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Prior model for dust parameters with specific allowed models."]; "PriorModel" -> "PriorDustModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PriorMassModel" [URL="api/beast.physicsmodel.priormodel.PriorMassModel.html#beast.physicsmodel.priormodel.PriorMassModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Prior model for mass parameter with specific allowed models."]; "PriorModel" -> "PriorMassModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PriorMetallicityModel" [URL="api/beast.physicsmodel.priormodel.PriorMetallicityModel.html#beast.physicsmodel.priormodel.PriorMetallicityModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Prior model for metallicity parameter with specific allowed models."]; "PriorModel" -> "PriorMetallicityModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PriorModel" [URL="api/beast.physicsmodel.priormodel.PriorModel.html#beast.physicsmodel.priormodel.PriorModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Compute the priors as weights given the input grid"]; }

beast.physicsmodel.grid_weights_stars Module

Grid Weights

The use of a non-uniformly 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 non-uniform 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 non-uniformly 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 non-uniform spacing.

Basically, we want the maginalization using these grid weights to provide flat priors on all the fit parameters. Non-flat priors will be implemented with prior weights.

Functions

compute_age_mass_metallicity_weights(_tgrid, ...)

Computes the age-mass-metallicity grid and prior weights on the BEAST model spectra grid Grid and prior weight columns updated by multiplying by the age-mass-metallicity weight.

compute_distance_age_mass_metallicity_weights(_tgrid)

Computes the distance and age-mass-metallicity grid and prior weights on the BEAST model spectra grid

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

digraph inheritance69d3e5b6fe { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ModelGrid" [URL="api/beast.physicsmodel.grid.ModelGrid.html#beast.physicsmodel.grid.ModelGrid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generic class"]; "SEDGrid" [URL="api/beast.physicsmodel.grid.SEDGrid.html#beast.physicsmodel.grid.SEDGrid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generate a grid that the full observational model (SEDs)."]; "ModelGrid" -> "SEDGrid" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SpectralGrid" [URL="api/beast.physicsmodel.grid.SpectralGrid.html#beast.physicsmodel.grid.SpectralGrid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generate a grid that contains spectra."]; "ModelGrid" -> "SpectralGrid" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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 low-memory 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

digraph inheritance1c08d9929e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CacheBackend" [URL="api/beast.physicsmodel.helpers.gridbackends.CacheBackend.html#beast.physicsmodel.helpers.gridbackends.CacheBackend",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Load content from a file only when needed"]; "GridBackend" -> "CacheBackend" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DiskBackend" [URL="api/beast.physicsmodel.helpers.gridbackends.DiskBackend.html#beast.physicsmodel.helpers.gridbackends.DiskBackend",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Reads the data from disk when it is accessed. This supports reading"]; "GridBackend" -> "DiskBackend" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GridBackend" [URL="api/beast.physicsmodel.helpers.gridbackends.GridBackend.html#beast.physicsmodel.helpers.gridbackends.GridBackend",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="How the content of a grid is handled. The idea is to provide enough"]; "MemoryBackend" [URL="api/beast.physicsmodel.helpers.gridbackends.MemoryBackend.html#beast.physicsmodel.helpers.gridbackends.MemoryBackend",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Instanciate a grid object that has no physical storage"]; "GridBackend" -> "MemoryBackend" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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.