Materials Library – pyne.dbgen.materials_library

Module handles the construction of a reference materials library in nuc_data.h5. This currently consists to natural element materials and those coming from PNNL’s Materials Compendium.

pyne.dbgen.materials_library.grab_materials_compendium(location='materials_compendium.csv')[source]

Parses data from a materials compendium csv file.

Parameters:

location : str

The file to read in compendium from.

Returns:

mats : list of pyne.material.Material

The materials in the compendium.

pyne.dbgen.materials_library.is_comp_matname_or_density(line)[source]

Detect composition, material name, or density lines.

Parameters:

line : list of str

The input line.

Returns:

result : bool

True if the input line has composition, material name, or density data. False otherwise.

pyne.dbgen.materials_library.make_elements()[source]

Make natural elemental materials based on isotopic abundances.

Returns:

eltsdict : dict from str to pyne.material.Material

Natural elements as materials.

pyne.dbgen.materials_library.make_materials_compendium(nuc_data, matslib)[source]

Adds materials compendium to nuc_data.h5.

pyne.dbgen.materials_library.make_materials_library(args)[source]

Controller function for adding materials library.

pyne.dbgen.materials_library.make_matslib(fname)[source]

Make a pyne.material.MaterialLibrary. First makes elements, then materials from compendium.

Parameters:

fname : str

Path to materials compendium.

Returns:

matslib : pyne.material.MaterialLibrary

All the materials you could want, in a handy MaterialLibrary instance.

pyne.dbgen.materials_library.parse_materials(mats, lines)[source]

Take first material from lines and append to mats.

Parameters:

mats : dict from str to pyne.material.Material

The growing dict of materials.

lines: list of list of str

The shrinking list of lines.