Skip to content
Projects

opencr.data.importers

Importers for published data formats.

  • lxcat_reactions: electron-impact processes from an LXCat file (read by plasmacoll.read_lxcat), as reactions between states of a network. LXCat’s terms of use do not allow redistribution: the files stay with the user and OpenCR never bundles them.
  • read_rate_table: a two-column text file of temperature (eV) and rate coefficient (SI), as a Tabulated rate model.
  • read_adf11: an ADAS adf11 file of effective (collisional-radiative) coefficients, such as OPEN-ADAS scd12_h.dat and acd12_h.dat, for comparisons. OPEN-ADAS data are for personal use and must not be redistributed: OpenCR reads the user’s own downloads and never ships them.

Every importer checks the data (opencr.data.checks) and attaches a provenance.

Attributes

NameDescription
LXCAT_KINDSNo description.

Classes

NameDescription
Adf11Effective coefficients of one charge state from an ADAS adf11 file.

Functions

NameDescription
lxcat_reactionsReturn the excitation, ionization and attachment processes of an LXCat file.
read_adf11Read one block (charge state) of an unresolved ADAS adf11 file.
read_rate_tableRead a two-column table of temperature (eV) and rate coefficient.

LXCAT_KINDSattributemodule attribute#

LXCAT_KINDS = {'EXCITATION': 'excitation', 'IONIZATION': 'ionization', 'ATTACHMENT': 'attachment'}

Adf11classdataclass#

class Adf11(density: np.ndarray, temperature: np.ndarray, coefficient: np.ndarray, header: str)

Effective coefficients of one charge state from an ADAS adf11 file.

Attributes

NameTypeDescription
densitynp.ndarrayThe electron densities in m^-3.
temperaturenp.ndarrayThe electron temperatures in eV.
coefficientnp.ndarrayThe coefficients in m^3/s, shape (temperature, density).
headerstrThe first line of the file.

coefficientattributeinstance attribute#

coefficient: np.ndarray

densityattributeinstance attribute#

density: np.ndarray

headerattributeinstance attribute#

header: str

temperatureattributeinstance attribute#

temperature: np.ndarray

lxcat_reactionsfunction#

def lxcat_reactions(path: str | Path, target: State, products: Callable[[str, str], tuple[State, ...] | None] | Mapping[str, tuple[State, ...]], database: str, retrieved: str | None = None) -> list[Reaction]

Return the excitation, ionization and attachment processes of an LXCat file.

Elastic and effective blocks change no population and are skipped.

Parameters

NameTypeDefaultDescription
pathstr | PathrequiredThe LXCat file.
targetStaterequiredThe target state of every process (e.g. Ar ground state).
productsCallable[[str, str], tuple[State, ...] | None] | Mapping[str, tuple[State, ...]]requiredThe product states of a block, by the block’s product text ("Ar*(11.55eV)") or as a function of (kind, product); the electron is added. A block whose products are None or absent is skipped.
databasestrrequiredThe database and its reference as the user’s download cites it, e.g. "Biagi-v7.1, www.lxcat.net, retrieved 2026-10-27".
retrievedstr | NoneNoneThe download date (ISO 8601); today if not given.

Returns

list[Reaction]
The reactions, named "<kind>:<target>-><products>".

read_adf11function#

def read_adf11(path: str | Path, block: int = 0) -> Adf11

Read one block (charge state) of an unresolved ADAS adf11 file.

The file gives log10 densities in cm^-3, log10 temperatures in eV and log10 coefficients in cm^3/s; they are returned in SI.

read_rate_tablefunction#

def read_rate_table(path: str | Path, reference: Reference, depends_on: str = 'electron', threshold: float = 0.0, unit_factor: float = 1.0, licence: str = 'unknown') -> tuple[Tabulated, Provenance]

Read a two-column table of temperature (eV) and rate coefficient.

Lines starting with # are comments. unit_factor converts the rates to SI (e.g. 1e-6 for cm^3/s) and is recorded in the provenance.

Returns

tuple[Tabulated, Provenance]
The rate model and its provenance.