tardis.opacities.macro_atom.macroatom_state module¶
- class tardis.opacities.macro_atom.macroatom_state.LegacyMacroAtomState(*args: Any, **kwargs: Any)[source]¶
Bases:
HDFWriterMixin
Current State of the MacroAtom
- Parameters:
- transition_probabilitiespd.DataFrame
Macro Atom Transition probabilities between levels
- transition_typepd.DataFrame)
Macro Atom transition types
- destination_level_idpd.DataFrame
ID of destination levels of the Macro Atom
- transition_line_idpd.DataFrame
ID of lines corresponding to Macro Atom transitions
- macro_block_referencespd.DataFrame or np.ndarray
Index references to the Macro Atom blocks
- line2macro_level_upperpd.DataFrame
Mapping from lines to Macro Atom upper levels
- classmethod from_legacy_plasma(plasma)[source]¶
Generates a MacroAtomState object from a tardis BasePlasma
- Parameters:
- plasmatardis.plasma.BasePlasma
legacy base plasma
- Returns:
- MacroAtomState
- hdf_name = 'macro_atom_state'¶
- hdf_properties = ['transition_probabilities', 'transition_type', 'destination_level_id', 'transition_line_id', 'macro_block_references', 'line2macro_level_upper']¶
- class tardis.opacities.macro_atom.macroatom_state.MacroAtomState(transition_probabilities: DataFrame, transition_metadata: DataFrame, line2macro_level_upper: Series)[source]¶
Bases:
object
Current State of the MacroAtom
- Parameters:
- transition_probabilitiespd.DataFrame
Transition probabilities for the macro atom, indexed by source and destination levels.
- transition_metadatapd.DataFrame
Metadata for the macro atom, including atomic number, ion number, level numbers for the transition, desination, and source.
- line2macro_level_upperpd.Series
Mapping from lines to the upper levels of the macro atom transitions.
- hdf_name = 'macro_atom_state'¶
- hdf_properties = ['transition_probabilities', 'transition_metadata', 'line2macro_level_upper']¶
- recreate_legacy_macro_atom_state(legacy_state: LegacyMacroAtomState, lines: DataFrame) LegacyMacroAtomState [source]¶
Recreate the legacy MacroAtomState with new transition probabilities and new unique transition ids.
- Parameters:
- linespd.DataFrame
DataFrame containing line information.
- Returns:
- LegacyMacroAtomState
The recreated legacy MacroAtomState.
- sort_to_legacy(legacy_state: LegacyMacroAtomState, lines: DataFrame) MacroAtomState [source]¶
Sort the current MacroAtomState to match the legacy MacroAtomState.
- Parameters:
- legacy_stateLegacyMacroAtomState
The legacy state to sort to.
- linespd.DataFrame
DataFrame containing line information.
- Returns:
- MacroAtomState
A new MacroAtomState sorted to match the legacy state.