solrat.atom_model.multi_term_atom_model.object.level_registry module

class solrat.atom_model.multi_term_atom_model.object.level_registry.LevelRegistry[source]

Bases: object

This class serves as a registry for all terms and levels. Level is {\(\beta, L, S, J\)}. Term is {\(\beta, L, S\)}.

register_level(beta: str, L: float, S: float, J: float, energy_cmm1: float)[source]

Register a new level.

Parameters:
  • beta – a string denoting the inner set of quantum numbers.

  • L – half-int Orbital momentum.

  • S – half-int Spin momentum.

  • J – half-int Total momentum.

  • energy_cmm1 – Level energy in [1/cm]

static construct_term_id(beta: str, L: float, S: float) str[source]

Construct a unique term ID

static construct_level_id(beta: str, L: float, S: float, J: float) str[source]

Construct a unique level ID

register_term_if_needed(term_id: str, beta: str, L: float, S: float)[source]

Register a new term (if not already registered).

validate()[source]

Perform a sanity check on all terms and levels: For each term, there should be all levels with \(J\) from \(|L-S|\) to \(L+S\)

get_level(term: Term, J: float) Level[source]

Get level from term and \(J\).

get_term(beta: str, L: float, S: float) Term[source]

Get term from \(\beta, L, S\)

class solrat.atom_model.multi_term_atom_model.object.level_registry.Term(term_id: str, beta: str, L: float, S: float)[source]

Bases: object

Term is {\(\beta, L, S\)}

Parameters:
  • term_id – unique ID

  • beta – a string denoting the inner set of quantum numbers.

  • L – half-int Orbital momentum.

  • S – half-int Spin momentum.

set_artificial_spin_scale(artificial_S_scale: float)[source]

Set the artificial_S_scale. Caution: this is an experimental feature.

The idea behind this mechanic is that the magnetic sensitivity of a line can be different from what LS coupling suggests. Therefore, this parameter can be used as a crude approach to model a different magnetic sensitivity by artificially scaling equation (3.3) as:

\[H_B = \mu_0 * (J_z + scale * S_z) * B.\]

For regular LS, \(scale=1\).

register_level(level: Level)[source]

Register a level to this term.

get_level(J) Level[source]

Get the level with the given \(J\) value.

get_mean_energy_cmm1() float[source]

Get the non-weighted mean energy of the term.

get_max_energy_cmm1() float[source]

Get maximum level energy within this term

get_min_energy_cmm1() float[source]

Get minimum level energy within this term

class solrat.atom_model.multi_term_atom_model.object.level_registry.Level(term: Term, level_id: str, J: float, energy_cmm1: float)[source]

Bases: object

Level is {\(eta, L, S, J\)}

Parameters:
  • term – Term instance

  • level_id – Unique level ID

  • J – half-int Total momentum.

  • energy_cmm1 – Level energy in [1/cm]