rockverse.dualenergyct.PeriodicTable#

class rockverse.dualenergyct.PeriodicTable(zgroup)[source]#

Manages periodic table information for the Monte Carlo Dual Energy Computed Tomography (DECT) processing. This class allows for the retrieval and modification of atomic numbers and masses for elements used in DECT processing.

Note

This class is designed to be created and managed within the main DualEnergyCTGroup. It should not be called directly.

Parameters:

zgroup (zarr.hierarchy.Group) – The Zarr group where the main DualEnergyCTGroup is stored.

Examples

Create a dual energy CT group. The periodic table will be created using default values:

>>> import rockverse as rv
>>> dectgroup = rv.dualenergyct.create_group('/path/to/group/dir')
>>> dectgroup.periodic_table

You can get the values for a specific element using a key in the format ‘<element>/Z’ for atomic number or ‘<element>/M’ for atomic mass:

>>> dectgroup.periodic_table['O/Z'] # Oxygen atomic number
8
>>> dectgroup.periodic_table['C/M'] # Carbon atomic mass
12.011

If you want to fine tune Z or M values, you can set new values just like you get current values:

>>> dectgroup.periodic_table['C/M']  get current value
12.011
>>> dectgroup.periodic_table['C/M'] = 12.109999 # set new value
>>> dectgroup.periodic_table['C/M'] # check...
12.109999

Exceptions will be raised if the element is not in the table, if value for Z is not a positive integer, or if value for M is not a positive integer or float.

Methods#

PeriodicTable.as_dict()

Returns the periodic table as a dictionary.

PeriodicTable.as_dataframe()

Returns the periodic table as a pandas DataFrame.

PeriodicTable.add_element(name, Z, M)

Adds a new element to the periodic table.