Material LibraryΒΆ

Download the full notebook.

material_library

Material Library

PyNE comes with a pre-built library of materials Most of this data comes from a materials compendium by PNNL, which is gives canonical values for normal materials. This notebook demonstrates how to load and use this data via the MaterialLibrary class. First the imports!

In [1]:
# the path to the nuc_data.h5 database
from pyne import nuc_data

# the material library class itself
from pyne.material import MaterialLibrary

The MaterialLibrary class is a dict-like class which maps string names to Material objects. We can instantiate this class directly from the database as follows.

In [2]:
mats = MaterialLibrary(nuc_data, datapath='/material_library/materials', nucpath='/material_library/nucid')

We can also take a gander at the keys in this dictionary.

In [3]:
mats.keys()[:10]
Out[3]:
['Mercury',
 'Oil, Crude (Heavy, Qayarah, Iraq)',
 'Sm',
 'Lead',
 'Concrete, M-1',
 'Sc',
 'Iron, Armco Ingot',
 'Freon-13',
 'Concrete, Luminite-colemanite-baryte',
 'Air (dry, near sea level)']

And the values too!

In [4]:
mats['Steel, Stainless 440']
Out[4]:
pyne.material.Material({60120000: 0.12366250000000002, 60130000: 0.0013375000000000004, 140280000: 0.11527875000000001, 140290000: 0.00585625, 140300000: 0.003865000000000001, 150310000: 0.12500000000000003, 160320000: 0.11873750000000001, 160330000: 0.0009375000000000001, 160340000: 0.005312500000000001, 160360000: 1.2500000000000002e-05, 240500000: 0.00543125, 240520000: 0.10473625000000002, 240530000: 0.011876250000000001, 240540000: 0.002956250000000001, 250550000: 0.12500000000000003, 260540000: 0.007306250000000001, 260560000: 0.11469250000000002, 260570000: 0.002648750000000001, 260580000: 0.0003525, 420920000: 0.0181625, 420940000: 0.011437500000000003, 420950000: 0.019800000000000005, 420960000: 0.020837500000000005, 420970000: 0.012000000000000002, 420980000: 0.030487500000000004, 421000000: 0.012275000000000003}, 1.0, 7.8, -1.0, {"name":"Steel, Stainless 440"})

You can do everything you normaly would with these materials, like print them out in MCNP form!

In [5]:
print mats['Steel, Stainless 440'].mcnp()
C name: Steel, Stainless 440
C density = 7.8
m?
     6012 -1.2366E-01
     6013 -1.3375E-03
     14028 -1.1528E-01
     14029 -5.8563E-03
     14030 -3.8650E-03
     15031 -1.2500E-01
     16032 -1.1874E-01
     16033 -9.3750E-04
     16034 -5.3125E-03
     16036 -1.2500E-05
     24050 -5.4313E-03
     24052 -1.0474E-01
     24053 -1.1876E-02
     24054 -2.9563E-03
     25055 -1.2500E-01
     26054 -7.3063E-03
     26056 -1.1469E-01
     26057 -2.6488E-03
     26058 -3.5250E-04
     42092 -1.8163E-02
     42094 -1.1438E-02
     42095 -1.9800E-02
     42096 -2.0838E-02
     42097 -1.2000E-02
     42098 -3.0488E-02
     42100 -1.2275E-02