Nuclide Naming Functions (cyclus.nucname)

Python wrapper for nucname library.

exception cyclus.nucname.NucTypeError(nuc=None)
add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

cyclus.nucname.alara(nuc)

Converts a nuclide to its ALARA form (‘am:242’).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : str

Output nuclide in name form.

cyclus.nucname.alara_to_id(nuc)

Converts a nuclide directly from ALARA form (‘am:242’) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in ALARA form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.anum(nuc)

Retrieves a nuclide’s nucleon number (95).

Parameters:

nuc : int or str

Input nuclide.

Returns:

a : int

The number of protons and neutrons in the nucleus.

cyclus.nucname.cinder(nuc)

Converts a nuclide to its CINDER (aaazzzm) form (2420951).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide in CINDER (aaazzzm) form.

cyclus.nucname.cinder_to_id(nuc)

Converts a nuclide directly from Cinder form (2420951) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in Cinder form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.ensdf_to_id(nuc)

Converts an ENSDF style id to a PyNE nuc_id

Parameters:

nuc : int

Input nuclide.

Returns:

newnuc : int

Output nuclide in nuc_id form.

cyclus.nucname.fluka(nuc)

Converts a nuclide to its FLUKA name.

Parameters:

nuc : int

Input nuclide.

Returns:

fluka_name : string

Output name in FLUKA form.

cyclus.nucname.fluka_to_id(name)

Converts a fluka name to the canonical identifier form.

Parameters:

name : str

Input name, expectedt to be one FLUKA knows

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.groundstate(nuc)

Converts a nuclide to its Groundstate form.

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide in Groundstate form.

cyclus.nucname.id(nuc)

Converts a nuclide to its identifier form (952420000).

If the input nuclide is in id form already, then this is function does no work. For all other formats, the id() function provides a best-guess based on a heirarchy of other formats that is used to resolve ambiguities between naming conventions. For integer input the form resolution order is:

  • id

  • zz (elemental z-num only given)

  • zzaaam

  • cinder (aaazzzm)

  • mcnp

  • zzaaa

For string (or char *) input the form resolution order is as follows:

  • ZZ-LL-AAAM

  • Integer form in a string representation, uses interger resolution

  • NIST

  • name form

  • Serpent

  • LL (element symbol)

For well-defined situations where you know ahead of time what format the nuclide is in, you should use the various form_to_id() functions, rather than the id() function which is meant to resolve possibly ambiquous cases.

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide id.

cyclus.nucname.id_to_state_id(nuc)

Converts a ENSDF state id to a PyNE nuc_id

Parameters:

nuc : int

Input nuclide.

Returns:

newnuc : int

Output nuclide in nuc_id form.

cyclus.nucname.iselement(nuc)

Test if nuc is a valid element.

Parameters:

nuc : int or str

Input element.

Returns:

flag : bool

cyclus.nucname.isnuclide(nuc)

Test if nuc is a valid nuclide.

Parameters:

nuc : int or str

Input nuclide(s).

Returns:

flag : bool

cyclus.nucname.mcnp(nuc)

Converts a nuclide to its MCNP form (92636).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide in MCNP form.

Notes

Most metastables in this form add 300 + 100*m where m is the isomeric state (U-236m = 92636). However, MCNP special cases Am-242 and Am-242m by switching the meaning. Thus Am-242m = 95242 and Am-242 = 95642.

cyclus.nucname.mcnp_to_id(nuc)

Converts a nuclide directly from MCNP form (92636) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in MCNP form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.name(nuc)

Converts a nuclide to its name form (‘Am242M’). The name() function first converts functions to id form using the id() function. Thus the form order resolution for id() also applies to here.

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : str

Output nuclide in name form.

cyclus.nucname.nist(nuc)

Converts a nuclide to NIST form (‘242Am’).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : str

Output nuclide in nist form.

cyclus.nucname.nist_to_id(nuc)

Converts a nuclide directly from NIST form (‘242Am’) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in NIST form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.serpent(nuc)

Converts a nuclide to its Serepnt form (‘Am-242m’).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : str

Output nuclide in serpent form.

cyclus.nucname.serpent_to_id(nuc)

Converts a nuclide directly from Serpent form (‘Am-242m’) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in Serpent form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.snum(nuc)

Retrieves a nuclide’s excitation number (95).

Parameters:

nuc : int or str

Input nuclide.

Returns:

s : int

The excitation level the nucleus.

cyclus.nucname.state_id_to_id(state)

Converts a ENSDF state id to a PyNE nuc_id

Parameters:

nuc : int

Input nuclide.

Returns:

newnuc : int

Output nuclide in nuc_id form.

cyclus.nucname.sza(nuc)

Converts a nuclide to its SZA form (SSSZZZAAA).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide in SZA form.

cyclus.nucname.sza_to_id(nuc)

Converts a nuclide directly from SZA form (SSSZZZAAA) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in SZA form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.znum(nuc)

Retrieves a nuclide’s charge number (95).

Parameters:

nuc : int or str

Input nuclide.

Returns:

z : int

The number of protons in the nucleus.

cyclus.nucname.zzaaam(nuc)

Converts a nuclide to its zzaaam form (952420).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide in zzaaam form.

cyclus.nucname.zzaaam_to_id(nuc)

Converts a nuclide directly from ZZAAAM form (952420) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in ZZAAAM form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.zzllaaam(nuc)

Converts a nuclide to its zzllaaam form (95-Am-241m).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : str

Output nuclide in zzllaaam form.

cyclus.nucname.zzllaaam_to_id(nuc)

Converts a nuclide directly from ZZLLAAAM form (95-Am-241m) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in ZZLLAAAM form.

Returns:

newnuc : int

Output nuclide in identifier form.

cyclus.nucname.zzzaaa(nuc)

Converts a nuclide to its zzzaaa form (95242).

Parameters:

nuc : int or str

Input nuclide.

Returns:

newnuc : int

Output nuclide in zzzaaa form.

cyclus.nucname.zzzaaa_to_id(nuc)

Converts a nuclide directly from ZZZAAA form (95242) to the canonical identifier form.

Parameters:

nuc : int or str

Input nuclide in ZZZAAA form.

Returns:

newnuc : int

Output nuclide in identifier form.