Exemple #1
0
    def get_iso_entries_from_comp(self, comp=None):
        if comp == None:
            comp = self.material.mult_by_mass()

        iso_entries = [ _IsoEntry(isotope=nucname.zzaam(iso).capitalize(), mass_weight=comp[iso]) 
                        for iso in sorted(comp.keys()) ]
        return iso_entries
Exemple #2
0
###############################################################################
# General Material View Helpers
###############################################################################


class _IsoEntry(HasTraits):
    """Isotope entry (row) for the mass stream table."""

    isotope = Str

    #mass_weight = Range(0.0, np.inf, 0.0)
    mass_weight = Float(0.0)

# Mass Stream isotopic filters
UFilter   = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 == 92,        name='Uranium')
PUFilter  = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 == 94,        name='Plutonium')
LANFilter = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 in isoname.lan, name='Lanthanides')
ACTFilter = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 in isoname.act, name='Actinides')
TRUFilter = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 in isoname.tru, name='Transuranics')
MAFilter  = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 in isoname.ma,  name='Minor Actinides')
FPFilter  = TableFilter(allowed=lambda x: nucname.zzaam(str(x.isotope))/10000 in isoname.fp,  name='Fission Products')


material_editor = TableEditor(
    columns = [ ObjectColumn(name='isotope',
                    label='Isotope',
                    #tooltip='Isotope name in natrual (LLAAAM) form.',
#                    width=0.20,
                    ),
                ObjectColumn(name='mass_weight',