tardis.plasma.assembly.base module

class tardis.plasma.assembly.base.PlasmaSolverFactory(atom_data, selected_atomic_numbers, config=None)[source]

Bases: object

Factory class for creating plasma solvers.

atom_dataobject

Object containing atomic data.

selected_atomic_numberslist

List of selected atomic numbers.

Attributes:
excitation_analytical_approximationstr

Analytical approximation for excitation (default: “lte”).

ionization_analytical_approximationstr

Analytical approximation for ionization (default: “lte”).

nebular_ionization_delta_treatmenttuple

Species to use for the delta_treatment in nebular ionization ML93 (default: ()).

link_t_rad_t_electronfloat

Link between t_rad and t_electron (default: 1.0).

radiative_rates_typestr

Type of radiative rates (default: “dilute-blackbody”).

delta_treatmentfloat or None

Delta treatment (default: None).

legacy_nlte_specieslist

List of legacy non-LTE species (default: []).

nlte_excitation_specieslist

List of non-LTE excitation species (default: []).

nlte_ionization_specieslist

List of non-LTE ionization species (default: []).

nlte_solverstr

Non-LTE solver (default: “lu”). Helium treatment options (default: “none”).

heating_rate_data_filestr

Heating rate data file (default: “none”).

continuum_interaction_specieslist

List of continuum interaction species (default: []).

enable_adiabatic_coolingbool

Flag for enabling adiabatic cooling (default: False).

enable_two_photon_decaybool

Flag for enabling two-photon decay (default: False).

line_interaction_typestr

Type of line interaction (default: “scatter”).

plasma_moduleslist

List of plasma modules (default: []).

kwargsdict

Additional keyword arguments (default: {}).

property_kwargsdict

Additional keyword arguments for properties (default: {}).

Methods

parse_plasma_config(plasma_config)

continuum_interaction_species_multi_index()

Get the continuum interaction species as a multi-index.

setup_factory(config)

setup_helium_treatment()

setup_legacy_nlte(nlte_config)

Set up the non-LTE properties for the legacy species.

setup_analytical_approximations()

Set up the analytical approximations for excitation and ionization.

initialize_j_blues(dilute_planckian_radiation_field, lines_df)

Initialize j_blues.

assemble(number_densities, dilute_planckian_radiation_field, time_explosion, electron_densities=None)[source]

Assemble the plasma based on the provided parameters and settings.

Parameters:
number_densitiesdict

Dictionary of number densities for different species.

dilute_planckian_radiation_fieldobject

The dilute Planckian radiation field object.

time_explosionfloat

The time of explosion.

electron_densitiesarray-like, optional

Optional electron densities.

Returns:
BasePlasma

The assembled plasma object.

Raises:
ValueError

If an error occurs during assembly.

check_continuum_interaction_species()[source]

Check if all continuum interaction species belong to atoms that have been specified in the configuration.

Raises:
PlasmaConfigError: If not all continuum interaction species belong to specified atoms.
continuum_interaction_species: list = []
property continuum_interaction_species_multi_index
delta_treatment: float | None = None
enable_adiabatic_cooling: bool = False
enable_two_photon_decay: bool = False
excitation_analytical_approximation: str = 'lte'
heating_rate_data_file: str = 'none'
helium_treatment: str = 'none'
initialize_continuum_properties(dilute_planckian_radiation_field)[source]

Initialize the continuum properties of the plasma.

Parameters:
dilute_planckian_radiation_fieldDilutePlanckianRadiationField

The dilute Planckian radiation field.

Returns:
initial_continuum_propertiesContinuumProperties

The initial continuum properties of the plasma.

initialize_j_blues(dilute_planckian_radiation_field, lines_df)[source]

Initialize the j_blues DataFrame based on the radiative_rates_type and the dilute_planckian_radiation_field.

Parameters:
dilute_planckian_radiation_fieldobject

The dilute Planckian radiation field object.

lines_dfpandas.DataFrame

The DataFrame containing lines information.

Returns:
pandas.DataFrame

The DataFrame with calculated mean intensity values.

Raises:
ValueError

If the radiative_rates_type is unknown.

ionization_analytical_approximation: str = 'lte'
kwargs: dict = {}
legacy_nlte_species: list = []
line_interaction_type: str = 'scatter'
nebular_ionization_delta_treatment: tuple = ()
nlte_excitation_species: list = []
nlte_ionization_species: list = []
nlte_solver: str = 'lu'
parse_plasma_config(plasma_config)[source]

Parse the plasma configuration.

Parameters:
plasma_configPlasmaConfig

The plasma configuration object containing the plasma parameters.

Returns:
None
plasma_modules: list = []
property_kwargs: dict = {}
radiative_rates_type: str = 'dilute-blackbody'
set_continuum_interaction_species_from_string(continuum_interaction_species)[source]

Set the continuum interaction species from a list of species strings.

Parameters:
continuum_interaction_specieslist of str

List of species strings representing the continuum interaction species.

Returns:
None
set_nlte_species_from_string(nlte_species)[source]

Sets the non-LTE species from a string representation.

Parameters:
nlte_speciesstr

A string representation of the non-LTE species.

Returns:
None

This method does not return anything.

setup_analytical_approximations()[source]

Setup the analytical approximations for excitation and ionization.

Returns:
None
setup_continuum_interactions()[source]

Set up continuum interactions for the plasma assembly.

Raises:
PlasmaConfigError: If the line_interaction_type is not “macroatom”.
PlasmaConfigError: If an NLTE ionization species is not in the continuum species.
PlasmaConfigError: If an NLTE excitation species is not in the continuum species.
PlasmaConfigError: If the NLTE solver type is unknown.
setup_electron_densities(electron_densities)[source]
setup_factory(config=None)[source]

Set up the plasma factory.

Parameters:
configobject, optional

Configuration object containing plasma settings (default: None).

setup_helium_treatment()[source]

Set up the helium treatment for the plasma assembly.

Parameters:
helium_treatmentstr

The type of helium treatment to be used. Possible values are: - “recomb-nlte”: Use recombination NLTE treatment for helium. - “numerical-nlte”: Use numerical NLTE treatment for helium.

heating_rate_data_filestr or None

The path to the heating rate data file. Required when using “numerical-nlte” helium treatment.

Raises:
PlasmaConfigError

If the helium NLTE treatment is incompatible with the NLTE ionization and excitation treatment.

If the heating rate data file is not specified when using “numerical-nlte” helium treatment.

setup_legacy_nlte(nlte_config)[source]

Set up the non-LTE (NLTE) properties for the legacy species.

Parameters:
nlte_configdict

A dictionary containing the NLTE configuration.

tardis.plasma.assembly.base.map_species_from_string(species)[source]