6.7. Atomic data repository

The following functions allow to manipulate the local atomic data repository: add the rates of the atomic processes, update existing ones or get the data already present in the repository.

The default repository is created at ~/.cherab/openadas/repository. Cherab supports multiple atomic data repositories. The user can configure different repositories by setting the repository_path parameter. The data in these repositories can be accessed through the OpenADAS atomic data provider by specifying the data_path parameter.

To create the new atomic data repository at the default location and populate it with a typical set of rates and wavelengths from Open-ADAS, do:

>>> from cherab.openadas.repository import populate
>>> populate()
cherab.openadas.repository.create.populate(download=True, repository_path=None, adas_path=None)

Populates the OpenADAS repository with a typical set of rates and wavelengths.

If an ADAS file is not note found an attempt will be made to download the file from the OpenADAS website. This behaviour can be disabled by setting the download argument to False.

Parameters:
  • download – Attempt to download the ADAS files if missing (default=True).

  • repository_path – Alternate path for the OpenADAS repository (default=None).

  • adas_path – Alternate path in which to search for ADAS files (default=None) .

6.7.1. Wavelength

cherab.openadas.repository.wavelength.add_wavelength(element, charge, transition, wavelength, repository_path=None)

Adds a single wavelength to the repository.

If adding multiple wavelengths, consider using the update_wavelengths() function instead. The update function avoid repeatedly opening and closing the rate files.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • transition – Tuple containing (initial level, final level).

  • wavelength – Transition’s wavelength in nm.

  • repository_path – Path to the atomic data repository.

cherab.openadas.repository.wavelength.get_wavelength(element, charge, transition, repository_path=None)

Reads the wavelength for the given species, charge and transition from the repository.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • transition – Tuple containing (initial level, final level).

  • repository_path – Path to the atomic data repository.

Return wavelength:

Wavelength in nm.

cherab.openadas.repository.wavelength.update_wavelengths(wavelengths, repository_path=None)

Updates the wavelength files /wavelength/<species>/<charge>.json in atomic data repository.

File contains multiple rates, indexed by the transitions.

Parameters:

wavelengths – Dictionary in the form:

{ <species>: { <charge>: { <transition>: <wavelength> } } }, where
<species> is the plasma species (Element/Isotope),
<charge> is the charge of the plasma species,
<transition> is the tuple containing (initial level, final level),
<wavelength> is the transition’s wavelength in nm.
Parameters:

repository_path – Path to the atomic data repository.

6.7.2. Ionisation

cherab.openadas.repository.atomic.add_ionisation_rate(species, charge, rate, repository_path=None)

Adds a single ionisation rate to the repository.

If adding multiple rates, consider using the update_ionisation_rates() function instead. The update function avoids repeatedly opening and closing the rate files.

Parameters:
  • species – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • rate – Ionisation rate dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with ionisation rate in m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.atomic.get_ionisation_rate(element, charge, repository_path=None)

Reads the ionisation rate for the given species and charge from the atomic data repository.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • repository_path – Path to the atomic data repository.

Return rate:

Ionisation rate dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with ionisation rate in m^3.s^-1.
cherab.openadas.repository.atomic.update_ionisation_rates(rates, repository_path=None)

Updates the ionisation rate files /ionisation/<species>.json in atomic data repository.

File contains multiple rates, indexed by the ion charge state.

Parameters:

rates – Dictionary in the form {<species>: {<charge>: <rate>}}, where

<species> is the plasma species (Element/Isotope),
<charge> is the charge of the plasma species,
<rate> is the ionisation rate dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with ionisation rate in m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

6.7.3. Recombination

cherab.openadas.repository.atomic.add_recombination_rate(species, charge, rate, repository_path=None)

Adds a single recombination rate to the repository.

If adding multiple rates, consider using the update_recombination_rates() function instead. The update function avoids repeatedly opening and closing the rate files.

Parameters:
  • species – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • rate – Recombination rate dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with recombination rate in m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.atomic.get_recombination_rate(element, charge, repository_path=None)

Reads the recombination rate for the given species and charge from the atomic data repository.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • repository_path – Path to the atomic data repository.

Return rate:

Recombination rate dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with recombination rate in m^3.s^-1.
cherab.openadas.repository.atomic.update_recombination_rates(rates, repository_path=None)

Updates the recombination rate files /recombination/<species>.json in the atomic data repository.

File contains multiple rates, indexed by the ion charge state.

Parameters:

rates – Dictionary in the form {<species>: {<charge>: <rate>}}, where

<species> is the plasma species (Element/Isotope),
<charge> is the charge of the plasma species,
<rate> is the recombination rate dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with recombination rate in m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

6.7.4. Thermal Charge Exchange

cherab.openadas.repository.atomic.add_thermal_cx_rate(donor_element, donor_charge, receiver_element, rate, repository_path=None)

Adds a single thermal charge exchange rate to the repository.

If adding multiple rates, consider using the update_recombination_rates() function instead. The update function avoids repeatedly opening and closing the rate files.

Parameters:
  • donor_element – Element donating the electron.

  • donor_charge – Charge of the donating atom/ion.

  • receiver_element – Element receiving the electron.

  • receiver_charge – Charge of the receiving atom/ion.

  • rate – Thermal CX rate dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with thermal CX rate in m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.atomic.get_thermal_cx_rate(donor_element, donor_charge, receiver_element, receiver_charge, repository_path=None)

Reads the thermal charge exchange rate for the given species and charge from the atomic data repository.

Parameters:
  • donor_element – Element donating the electron.

  • donor_charge – Charge of the donating atom/ion.

  • receiver_element – Element receiving the electron.

  • receiver_charge – Charge of the receiving atom/ion.

  • repository_path – Path to the atomic data repository.

Return rate:

Thermal CX rate dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with thermal CX rate in m^3.s^-1.
cherab.openadas.repository.atomic.update_thermal_cx_rates(rates, repository_path=None)

Updates the thermal charge exchange rate files /thermal_cx/<donor_element>/<donor_charge>/<receiver_element>.json in the atomic data repository.

File contains multiple rates, indexed by the ion charge state.

Parameters:

rates – Dictionary in the form:

{ <donor_element>: { <donor_charge>: { <receiver_element>: { <donor_charge>: <rate> } } } }, where
<donor_element> is the element donating the electron.
<donor_charge> is the charge of the donating atom/ion.
<receiver_element> is the element receiving the electron.
<receiver_charge> is the charge of the receiving atom/ion.
<rate> is the thermal CX rate dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with thermal CX rate in m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

6.7.5. Photon Emissivity Coefficients

cherab.openadas.repository.pec.add_pec_excitation_rate(element, charge, transition, rate, repository_path=None)

Adds a single PEC excitation rate to the repository.

If adding multiple rate, consider using the update_pec_rates() function instead. The update function avoid repeatedly opening and closing the rate files.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • transition – Tuple containing (initial level, final level).

  • rate – Excitation PEC dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with excitation PEC in photon.m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.pec.add_pec_recombination_rate(element, charge, transition, rate, repository_path=None)

Adds a single PEC recombination rate to the repository.

If adding multiple rate, consider using the update_pec_rates() function instead. The update function avoid repeatedly opening and closing the rate files.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • transition – Tuple containing (initial level, final level).

  • rate – Recombination PEC dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with recombination PEC in photon.m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.pec.add_pec_thermal_cx_rate(donor_element, donor_charge, receiver_element, receiver_charge, transition, rate, repository_path=None)

Adds a single PEC thermal charge exchange rate to the repository.

If adding multiple rate, consider using the update_pec_thermal_rates() function instead. The update function avoid repeatedly opening and closing the rate files.

Parameters:
  • donor_element – Electron donor plasma species (Element/Isotope).

  • donor_charge – Electron donor charge.

  • receiver_element – Electron receiver plasma species (Element/Isotope).

  • receiver_charge – Electron receiver charge.

  • transition – Tuple containing (initial level, final level).

  • rate – Thermal CX PEC dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘td’: array-like of size (K) with donor temperature in eV,
‘rate’: array-like of size (N, M, K) with thermal CX PEC in photon.m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.pec.get_pec_excitation_rate(element, charge, transition, repository_path=None)

Reads the excitation PEC from the repository for the given element, charge and transition.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • transition – Tuple containing (initial level, final level).

  • repository_path – Path to the atomic data repository.

Return rate:

Excitation PEC dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with excitation PEC in photon.m^3.s^-1.
cherab.openadas.repository.pec.get_pec_recombination_rate(element, charge, transition, repository_path=None)

Reads the recombination PEC from the repository for the given element, charge and transition.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • transition – Tuple containing (initial level, final level).

  • repository_path – Path to the atomic data repository.

Return rate:

Recombination PEC dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with recombination PEC in photon.m^3.s^-1.
cherab.openadas.repository.pec.get_pec_thermal_cx_rate(donor_element, donor_charge, receiver_element, receiver_charge, transition, repository_path=None)

Reads the thermal charge exchange PEC from the repository for the given donor element, donor charge, receiver element, receiver charge and transition.

Parameters:
  • donor_element – Electron donor plasma species (Element/Isotope).

  • donor_charge – Electron donor charge.

  • receiver_element – Electron receiver plasma species (Element/Isotope).

  • receiver_charge – Electron receiver charge.

  • transition – Tuple containing (initial level, final level).

  • repository_path – Path to the atomic data repository.

Return rate:

Thermal CX PEC dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘td’: 1D array of size (K) with donor temperature in eV,
‘rate’: 2D array of size (N, M, K) with thermal CX PEC in photon.m^3.s^-1.
cherab.openadas.repository.pec.update_pec_rates(rates, repository_path=None)

Updates excitation and recombination PEC files /pec/<class>/<element>/<charge>.json. in the atomic data repository.

File contains multiple PECs, indexed by the transition.

Parameters:

rates – Dictionary in the form:

{ <class>: { <element>: { <charge>: { <transition>: <pec> } } } }, where
<class> is the one of the following PEC types: ‘excitation’, ‘recombination’.
<element> is the plasma species (Element/Isotope).
<charge> is the charge of the plasma species.
<transition> is the tuple containing (initial level, final level).
<pec> is the PEC dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with PEC in photon.m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.pec.update_pec_thermal_cx_rates(rates, repository_path=None)

Updates thermal CX PEC files /pec/thermal_cx/<donor_element>/<donor_charge>/<receiver_element>/<receiver_charge>.json in the atomic data repository.

File contains multiple PECs, indexed by the transition.

Parameters:

rates – Dictionary in the form:

{ <donor_element>: { <donor_charge>: { <receiver_element>: { <receiver_charge>: { <transition>: <pec> } } } } }, where
<donor_element> is the electron donor species (Element/Isotope).
<donor_charge> is the electron donor charge.
<receiver_element> is the electron receiver species (Element/Isotope).
<receiver_charge> is the electron receiver charge.
<transition> is the tuple containing (initial level, final level).
<pec> is the PEC dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘td’: array-like of size (K) with donor temperature in eV,
‘rate’: array-like of size (N, M, K) with PEC in photon.m^3.s^-1.
Parameters:

repository_path – Path to the atomic data repository.

6.7.6. Radiated Power

cherab.openadas.repository.radiated_power.add_continuum_power_rate(species, charge, rate, repository_path=None)

Adds a single continuum power rate to the repository.

If adding multiple rates, consider using the update_continuum_power_rates() function instead. The update function avoids repeatedly opening and closing the rate files.

Parameters:
  • species – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • rate – Continuum power rate dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with continuum power rate in W.m^3.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.radiated_power.add_cx_power_rate(species, charge, rate, repository_path=None)

Adds a single CX radiation power rate to the repository (charge exchage with neutral hydrogen).

If adding multiple rates, consider using the update_cx_power_rates() function instead. The update function avoids repeatedly opening and closing the rate files.

Parameters:
  • species – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • rate – CX power rate dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with CX power rate in W.m^3.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.radiated_power.add_line_power_rate(species, charge, rate, repository_path=None)

Adds a single line radiated power rate to the repository.

If adding multiple rates, consider using the update_line_power_rates() function instead. The update function avoids repeatedly opening and closing the rate files.

Parameters:
  • species – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • rate – Line radiated power rate dictionary containing the following entries:

‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with line radiated power rate in W.m^3.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.radiated_power.get_continuum_radiated_power_rate(element, charge, repository_path=None)

Reads the continuum power rate for the given species and charge from the atomic data repository.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • repository_path – Path to the atomic data repository.

Return rate:

Continuum power rate dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with continuum power rate in W.m^3.
cherab.openadas.repository.radiated_power.get_cx_radiated_power_rate(element, charge, repository_path=None)

Reads the CX radiation power rate for the given species and charge from the atomic data repository.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • repository_path – Path to the atomic data repository.

Return rate:

CX radiation power rate dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with CX radiation power rate in W.m^3.
cherab.openadas.repository.radiated_power.get_line_radiated_power_rate(element, charge, repository_path=None)

Reads the line radiated power rate for the given species and charge from the atomic data repository.

Parameters:
  • element – Plasma species (Element/Isotope).

  • charge – Charge of the plasma species.

  • repository_path – Path to the atomic data repository.

Return rate:

Line radiated power rate dictionary containing the following entries:

‘ne’: 1D array of size (N) with electron density in m^-3,
‘te’: 1D array of size (M) with electron temperature in eV,
‘rate’: 2D array of size (N, M) with line radiated power rate in W.m^3.
cherab.openadas.repository.radiated_power.update_continuum_power_rates(rates, repository_path=None)

Update the files for the continuum power rates: /radiated_power/continuum/<species>.json in the atomic data repository.

File contains multiple rates, indexed by ion’s charge state.

Parameters:

rates – Dictionary in the form {<species>: {<charge>: <rate>}}, where

<species> is the plasma species (Element/Isotope),
<charge> is the charge of the plasma species,
<rate> is the continuum power rate dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with continuum power rate in W.m^3.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.radiated_power.update_cx_power_rates(rates, repository_path=None)

Update the files for the CX radiation power rates (charge exchage with neutral hydrogen): /radiated_power/cx/<species>.json in the atomic data repository.

File contains multiple rates, indexed by ion’s charge state.

Parameters:

rates – Dictionary in the form {<species>: {<charge>: <rate>}}, where

<species> is the plasma species (Element/Isotope),
<charge> is the charge of the plasma species,
<rate> is the thermal CX power rate dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with thermal CX power rate in W.m^3.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.radiated_power.update_line_power_rates(rates, repository_path=None)

Update the files for the line radiated power rates: /radiated_power/line/<species>.json in the atomic data repository.

File contains multiple rates, indexed by the ion’s charge state.

Parameters:

rates – Dictionary in the form {<species>: {<charge>: <rate>}}, where

<species> is the plasma species (Element/Isotope),
<charge> is the charge of the plasma species,
<rate> is the line radiated rate dictionary containing the following entries:
‘ne’: array-like of size (N) with electron density in m^-3,
‘te’: array-like of size (M) with electron temperature in eV,
‘rate’: array-like of size (N, M) with line radiated power rate in W.m^3.
Parameters:

repository_path – Path to the atomic data repository.

6.7.7. Beam

cherab.openadas.repository.beam.cx.add_beam_cx_rate(donor_ion, donor_metastable, receiver_ion, receiver_charge, transition, rate, repository_path=None)

Adds a single beam CX PEC to the repository.

If adding multiple rate, consider using the update_beam_cx_rates() function instead. The update function avoid repeatedly opening and closing the rate files.

Parameters:
  • donor_ion – Beam neutral atom (Element/Isotope) donating the electron.

  • donor_metastable – Metastable/excited level of beam neutral atom.

  • receiver_ion – Element/Isotope receiving the electron.

  • receiver_charge – Charge of the receiving atom/ion.

  • transition – Tuple containing (initial level, final level).

  • rate – Beam CX PEC dictionary containing the following entries:

‘eb’: array-like of size (N) with beam energy in eV/amu,
‘ti’: array-like of size (M) with receiver ion temperature in eV,
‘ni’: array-like of size (K) with plasma ion density in m^-3,
‘z’: array-like of size (L) with plasma Z-effective,
‘b’: array-like of size (J) with magnetic field strength in Tesla,
‘qeb’: array-like of size (N) with CX PEC energy component in photon.m^3.s-1,
‘qti’: array-like of size (M) with CX PEC temperature component in photon.m^3.s-1,
‘qni’: array-like of size (K) with CX PEC density component in photon.m^3.s-1,
‘qz’: array-like of size (L) with CX PEC Zeff component in photon.m^3.s-1,
‘qb’: array-like of size (J) with CX PEC B-field component in photon.m^3.s-1,
‘qref’: reference CX PEC in photon.m^3.s-1.
The total beam CX PEC: q = qeb * qti * qni * qz * qb / qref^4.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.cx.get_beam_cx_rates(donor_ion, receiver_ion, receiver_charge, transition, repository_path=None)

Reads a single beam CX PEC from the repository.

Parameters:
  • donor_ion – Beam neutral atom (Element/Isotope) donating the electron.

  • donor_metastable – Metastable/excited level of beam neutral atom.

  • receiver_ion – Element/Isotope receiving the electron.

  • receiver_charge – Charge of the receiving atom/ion.

  • transition – Tuple containing (initial level, final level).

  • repository_path – Path to the atomic data repository.

Return rate:

Beam CX PEC dictionary containing the following entries:

‘eb’: 1D array of size (N) with beam energy in eV/amu,
‘ti’: 1D array of size (M) with receiver ion temperature in eV,
‘ni’: 1D array of size (K) with plasma ion density in m^-3,
‘z’: 1D array of size (L) with plasma Z-effective,
‘b’: 1D array of size (J) with magnetic field strength in Tesla,
‘qeb’: 1D array of size (N) with CX PEC energy component in photon.m^3.s-1,
‘qti’: 1D array of size (M) with CX PEC temperature component in photon.m^3.s-1,
‘qni’: 1D array of size (K) with CX PEC density component in photon.m^3.s-1,
‘qz’: 1D array of size (L) with CX PEC Zeff component in photon.m^3.s-1,
‘qb’: 1D array of size (J) with CX PEC B-field component in photon.m^3.s-1,
‘qref’: reference CX PEC in photon.m^3.s-1.
The total beam CX PEC: q = qeb * qti * qni * qz * qb / qref^4.
cherab.openadas.repository.beam.cx.update_beam_cx_rates(rates, repository_path=None)

Updates the beam CX PEC files beam/cx/<donor_ion>/<receiver_ion>/<receiver_charge>.json in the atomic data repository.

File contains multiple metastable-resolved rates, indexed by transition.

Parameters:

rates – Dictionary in the form:

{ <donor_ion>: { <receiver_ion>: { <receiver_charge>: { <transition>: {<donor_metastable>: <rate>} } } } }, where
<donor_ion> is the beam neutral atom (Element/Isotope) donating the electron.
<donor_metastable> is the metastable/excited level of beam neutral atom.
<receiver_ion> is the Element/Isotope receiving the electron.
<receiver_charge> is the charge of the receiving atom/ion.
<transition> is the tuple containing (initial level, final level).
<rate> is the beam CX PEC dictionary containing the following entries:
‘eb’: array-like of size (N) with beam energy in eV/amu,
‘ti’: array-like of size (M) with receiver ion temperature in eV,
‘ni’: array-like of size (K) with plasma ion density in m^-3,
‘z’: array-like of size (L) with plasma Z-effective,
‘b’: array-like of size (J) with magnetic field strength in Tesla,
‘qeb’: array-like of size (N) with CX PEC energy component in photon.m^3.s-1,
‘qti’: array-like of size (M) with CX PEC temperature component in photon.m^3.s-1,
‘qni’: array-like of size (K) with CX PEC density component in photon.m^3.s-1,
‘qz’: array-like of size (L) with CX PEC Zeff component in photon.m^3.s-1,
‘qb’: array-like of size (J) with CX PEC B-field component in photon.m^3.s-1,
‘qref’: reference CX PEC in photon.m^3.s-1.
The total beam CX PEC: q = qeb * qti * qni * qz * qb / qref^4.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.emission.add_beam_emission_rate(beam_species, target_ion, target_charge, transition, rate, repository_path=None)

Adds a single beam emission rate to the repository.

If adding multiple rate, consider using the update_beam_emission_rates() function instead. The update function avoid repeatedly opening and closing the rate files.

Parameters:
  • beam_species – Beam neutral species (Element/Isotope).

  • target_ion – Target species (Element/Isotope).

  • target_charge – Charge of the target species.

  • transition – Tuple containing (initial level, final level).

  • rate – Beam emission rate dictionary containing the following entries:

‘e’: array-like of size (N) with interaction energy in eV/amu,
‘n’ array-like of size (M) with target electron density in m^-3,
‘t’ array-like of size (K) with target electron temperature in eV,
‘sen’ array-like of size (N, M) with beam emission rate energy component in photon.m^3.s^-1.
‘st’ array-like of size (K) with beam emission rate temperature component in photon.m^3.s^-1.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference beam emission rate in photon.m^3.s^-1.
The total beam emission rate: s = sen * st / sref.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.emission.get_beam_emission_rate(beam_species, target_ion, target_charge, transition, repository_path=None)

Reads a single beam emission rate from the repository.

Parameters:
  • beam_species – Beam neutral species (Element/Isotope).

  • target_ion – Target species (Element/Isotope).

  • target_charge – Charge of the target species.

  • transition – Tuple containing (initial level, final level).

  • repository_path – Path to the atomic data repository.

Return rate:

Beam emission rate dictionary containing the following entries:

‘e’: 1D array of size (N) with interaction energy in eV/amu,
‘n’ 1D array of size (M) with target electron density in m^-3,
‘t’ 1D array of size (K) with target electron temperature in eV,
‘sen’ 2D array of size (N, M) with beam emission rate energy component in photon.m^3.s^-1.
‘st’ 1D array of size (K) with beam emission rate temperature component in photon.m^3.s^-1.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference beam emission rate in photon.m^3.s^-1.
The total beam emission rate: s = sen * st / sref.
cherab.openadas.repository.beam.emission.update_beam_emission_rates(rates, repository_path=None)

Updates the beam emission rate files: /beam/emission/<beam species>/<target ion>/<target_charge>.json in the atomic repository.

File contains multiple rates, indexed by transition.

Parameters:

rates – Dictionary in the form:

{ <beam_species>: { <target_ion>: { <target_charge>: {<transition>: <rate>} } } }, where
<beam_species> is the beam neutral species (Element/Isotope)
<target_ion> is the target species (Element/Isotope).
<target_charge> is the charge of the target species.
<transition> is the tuple containing (initial level, final level).
<rate> Beam emission rate dictionary containing the following entries:
‘e’: array-like of size (N) with interaction energy in eV/amu,
‘n’ array-like of size (M) with target electron density in m^-3,
‘t’ array-like of size (K) with target electron temperature in eV,
‘sen’ array-like of size (N, M) with beam emission rate energy component in photon.m^3.s^-1.
‘st’ array-like of size (K) with beam emission rate temperature component in photon.m^3.s^-1.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference beam emission rate in photon.m^3.s^-1.
The total beam emission rate: s = sen * st / sref.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.population.add_beam_population_rate(beam_species, beam_metastable, target_ion, target_charge, rate, repository_path=None)

Adds a single beam population rate to the repository.

Parameters:
  • beam_species – Beam neutral species (Element/Isotope).

  • beam_metastable – Metastable level of beam neutral atom.

  • target_ion – Target species (Element/Isotope).

  • target_charge – Charge of the target species.

  • rate – Beam population rate dictionary containing the following entries:

‘e’: array-like of size (N) with interaction energy in eV/amu,
‘n’: array-like of size (M) with target electron density in m^-3,
‘t’: array-like of size (K) with target electron temperature in eV,
‘sen’: array-like of size (N, M) with dimensionless beam population rate energy component.
‘st’: array-like of size (K) with dimensionless beam population rate temperature component.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference dimensionless beam population rate.
The total beam population rate: s = sen * st / sref.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.population.get_beam_population_rate(beam_species, beam_metastable, target_ion, target_charge, repository_path=None)

Reads a single beam population rate from the repository.

Parameters:
  • beam_species – Beam neutral species (Element/Isotope).

  • beam_metastable – Metastable level of beam neutral atom.

  • target_ion – Target species (Element/Isotope).

  • target_charge – Charge of the target species.

  • repository_path – Path to the atomic data repository.

Return rate:

Beam population rate dictionary containing the following entries:

‘e’: 1D array of size (N) with interaction energy in eV/amu,
‘n’: 1D array of size (M) with target electron density in m^-3,
‘t’: 1D array of size (K) with target electron temperature in eV,
‘sen’: 2D array of size (N, M) with dimensionless beam population rate energy component.
‘st’: 1D array of size (K) with dimensionless beam population rate temperature component.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference dimensionless beam population rate.
The total beam population rate: s = sen * st / sref.
cherab.openadas.repository.beam.population.update_beam_population_rates(rates, repository_path=None)

Updates the beam population rate files /beam/population/<beam species>/<beam metastable>/<target ion>/<target_charge>.json in the atomic data repository.

Each json file contains a single rate, so it can simply be replaced.

Parameters:

rates – Dictionary in the form:

{ <beam_species>: { <beam_metastable>: { <target_ion>: {<target_charge>: <rate>} } } }, where
<beam_species> is the beam neutral species (Element/Isotope)
<beam_metastable> is the metastable level of beam neutral atom.
<target_ion> is the target species (Element/Isotope).
<target_charge> is the charge of the target species.
<rate> is the beam population rate dictionary containing the following fields:
‘e’: array-like of size (N) with interaction energy in eV/amu,
‘n’: array-like of size (M) with target electron density in m^-3,
‘t’: array-like of size (K) with target electron temperature in eV,
‘sen’: array-like of size (N, M) with dimensionless beam population rate energy component.
‘st’: array-like of size (K) with dimensionless beam population rate temperature component.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference dimensionless beam population rate.
The total beam population rate: s = sen * st / sref.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.stopping.add_beam_stopping_rate(beam_species, target_ion, target_charge, rate, repository_path=None)

Adds a single beam stopping/excitation rate to the repository.

Parameters:
  • beam_species – Beam neutral atom (Element/Isotope).

  • target_ion – Target species (Element/Isotope).

  • target_charge – Charge of the target species.

  • rate – Beam stopping rate dictionary containing the following entries:

‘e’: array-like of size (N) with interaction energy in eV/amu,
‘n’: array-like of size (M) with target electron density in m^-3,
‘t’: array-like of size (K) with target electron temperature in eV,
‘sen’: array-like of size (N, M) with beam stopping rate energy component in m^3.s^-1.
‘st’: array-like of size (K) with beam stopping rate temperature component in m^3.s^-1.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference beam stopping rate in m^3.s^-1.
The total beam stopping rate: s = sen * st / sref.
Parameters:

repository_path – Path to the atomic data repository.

cherab.openadas.repository.beam.stopping.get_beam_stopping_rate(beam_species, target_ion, target_charge, repository_path=None)

Reads a single beam stopping/excitation rate from the repository.

Parameters:
  • beam_species – Beam neutral atom (Element/Isotope).

  • target_ion – Target species (Element/Isotope).

  • target_charge – Charge of the target species.

  • repository_path – Path to the atomic data repository.

Return rate:

Beam stopping rate dictionary containing the following entries:

‘e’: 1D array of size (N) with interaction energy in eV/amu,
‘n’: 1D array of size (M) with target electron density in m^-3,
‘t’: 1D array of size (K) with target electron temperature in eV,
‘sen’: 2D array of size (N, M) with beam stopping rate energy component in m^3.s^-1.
‘st’: 1D array of size (K) with beam stopping rate temperature component in m^3.s^-1.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference beam stopping rate in m^3.s^-1.
The total beam stopping rate: s = sen * st / sref.
cherab.openadas.repository.beam.stopping.update_beam_stopping_rates(rates, repository_path=None)

Updates the beam stopping rate files /beam/stopping/<beam species>/<beam metastable>/<target ion>/<target_charge>.json in the atomic data repository.

Each json file contains a single rate, so it can simply be replaced.

Parameters:

rates – Dictionary in the form:

{ <beam_species>: { <beam_metastable>: { <target_ion>: {<target_charge>: <rate>} } } }, where
<beam_species> is the beam neutral species (Element/Isotope).
<target_ion> is the target species (Element/Isotope).
<target_charge> is the charge of the target species.
<rate> is the beam stopping rate dictionary containing the following entries:
‘e’: array-like of size (N) with interaction energy in eV/amu,
‘n’: array-like of size (M) with target electron density in m^-3,
‘t’: array-like of size (K) with target electron temperature in eV,
‘sen’: array-like of size (N, M) with beam stopping rate energy component in m^3.s^-1.
‘st’: array-like of size (K) with beam stopping rate temperature component in m^3.s^-1.
‘eref’: reference interaction energy in eV/amu,
‘nref’: reference target electron density in m^-3,
‘tref’: reference target electron temperature in eV,
‘sref’: reference beam stopping rate in m^3.s^-1.
The total beam stopping rate: s = sen * st / sref.