tardis.visualization.widgets.shell_info module

class tardis.visualization.widgets.shell_info.BaseShellInfo(t_radiative, dilution_factor, abundance, number_density, ion_number_density, level_number_density)[source]

Bases: object

The simulation information that is used by shell info widget

Initialize the object with all simulation properties in use

Parameters
t_radiativearray_like

Radiative Temperature of each shell of simulation

dilution_factorarray_like

Dilution Factor (W) of each shell of simulation model

abundancepandas.DataFrame

Fractional abundance of elements where row labels are atomic number and column labels are shell number

number_densitypandas.DataFrame

Number densities of elements where row labels are atomic number and column labels are shell numbers

ion_number_densitypandas.DataFrame

Number densities of ions where rows are multi-indexed with (atomic number, ion number) and column labels are shell number

level_number_densitypandas.DataFrame

Number densities of levels where rows are multi-indexed with (atomic number, ion number, level number) and column labels are shell number

element_count(shell_num)[source]

Generates fractional abundance of elements present in a specific shell in a form that can be used by a table widget

Parameters
shell_numint

Shell number (note: starts from 1, not 0 which is what simulation model use)

Returns
pandas.DataFrame

Dataframe containing element symbol and fractional abundance in a specific shell, against each atomic number

ion_count(atomic_num, shell_num)[source]

Generates fractional abundance of ions of a specific element and shell, in a form that can be used by a table widget

Parameters
atomic_numint

Atomic number of element

shell_numint

Shell number (note: starts from 1, not 0 which is what simulation model use)

Returns
pandas.DataFrame

Dataframe containing ion specie and fractional abundance for a specific element, against each ion number

level_count(ion, atomic_num, shell_num)[source]

Generates fractional abundance of levels of a specific ion, element and shell, in a form that can be used by a table widget

Parameters
ionint

Ion number (note: starts from 0, same what is used by simulation model)

atomic_numint

Atomic number of element

shell_numint

Shell number (note: starts from 1, not 0 which is what simulation model use)

Returns
pandas.DataFrame

Dataframe containing fractional abundance for a specific ion, against each level number

shells_data()[source]

Generates shells data in a form that can be used by a table widget

Returns
pandas.DataFrame

Dataframe containing Rad. Temp. and W against each shell of simulation model

class tardis.visualization.widgets.shell_info.HDFShellInfo(hdf_fpath)[source]

Bases: BaseShellInfo

The simulation information that is used by shell info widget, obtained from a simulation HDF file

Initialize the object with a simulation HDF file

Parameters
hdf_fpathstr

A valid path to a simulation HDF file (HDF file must be created from a TARDIS Simulation object using to_hdf method with default arguments)

class tardis.visualization.widgets.shell_info.ShellInfoWidget(shell_info_data)[source]

Bases: object

The Shell Info Widget to explore abundances in different shells.

It consists of four interlinked table widgets - shells table; element count, ion count and level count tables - allowing to explore fractional abundances all the way from elements, to ions, to levels by clicking on the rows of tables.

Initialize the object with the shell information of a simulation model

Parameters
shell_info_datasubclass of BaseShellInfo

Shell information object constructed from Simulation object or HDF file

display(shells_table_width='30%', element_count_table_width='24%', ion_count_table_width='24%', level_count_table_width='18%', **layout_kwargs)[source]

Display the shell info widget by putting all component widgets nicely together and allowing interaction between the table widgets

Parameters
shells_table_widthstr, optional

CSS width property value for shells table, by default ‘30%’

element_count_table_widthstr, optional

CSS width property value for element count table, by default ‘24%’

ion_count_table_widthstr, optional

CSS width property value for ion count table, by default ‘24%’

level_count_table_widthstr, optional

CSS width property value for level count table, by default ‘18%’

Returns
ipywidgets.Box

Shell info widget containing all component widgets

Other Parameters
**layout_kwargs

Any valid CSS properties to be passed to the layout attribute of table widgets container (HTML div) as explained in ipywidgets documentation

update_element_count_table(event, qgrid_widget)[source]

Event listener to update the data in element count table widget based on interaction (row selected event) in shells table widget.

Parameters
eventdict

Dictionary that holds information about event (see Notes section)

qgrid_widgetqgrid.QgridWidget

QgridWidget instance that fired the event (see Notes section)

Notes

You will never need to pass any of these arguments explicitly. This is the expected signature of the function passed to handler argument of on method of a table widget (qgrid.QgridWidget object) as explained in qrid documentation.

update_ion_count_table(event, qgrid_widget)[source]

Event listener to update the data in ion count table widget based on interaction (row selected event) in element count table widget.

Parameters
eventdict

Dictionary that holds information about event (see Notes section)

qgrid_widgetqgrid.QgridWidget

QgridWidget instance that fired the event (see Notes section)

Notes

You will never need to pass any of these arguments explicitly. This is the expected signature of the function passed to handler argument of on method of a table widget (qgrid.QgridWidget object) as explained in qrid documentation.

update_level_count_table(event, qgrid_widget)[source]

Event listener to update the data in level count table widget based on interaction (row selected event) in ion count table widget.

Parameters
eventdict

Dictionary that holds information about event (see Notes section)

qgrid_widgetqgrid.QgridWidget

QgridWidget instance that fired the event (see Notes section)

Notes

You will never need to pass any of these arguments explicitly. This is the expected signature of the function passed to handler argument of on method of a table widget (qgrid.QgridWidget object) as explained in qrid documentation.

class tardis.visualization.widgets.shell_info.SimulationShellInfo(sim_model)[source]

Bases: BaseShellInfo

The simulation information that is used by shell info widget, obtained from a TARDIS Simulation object

Initialize the object with TARDIS Simulation object

Parameters
sim_modeltardis.simulation.Simulation

TARDIS Simulation object produced by running a simulation

tardis.visualization.widgets.shell_info.shell_info_from_hdf(hdf_fpath)[source]

Create shell info widget from a simulation HDF file

Parameters
hdf_fpathstr

A valid path to a simulation HDF file (HDF file must be created from a TARDIS Simulation object using to_hdf method with default arguments)

Returns
ShellInfoWidget
tardis.visualization.widgets.shell_info.shell_info_from_simulation(sim_model)[source]

Create shell info widget from a TARDIS simulation object

Parameters
sim_modeltardis.simulation.Simulation

TARDIS Simulation object produced by running a simulation

Returns
ShellInfoWidget