opencr.data.importers
Importers for published data formats.
lxcat_reactions: electron-impact processes from an LXCat file (read byplasmacoll.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 aTabulatedrate model.read_adf11: an ADAS adf11 file of effective (collisional-radiative) coefficients, such as OPEN-ADASscd12_h.datandacd12_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
| Name | Description |
|---|---|
LXCAT_KINDS | No description. |
Classes
| Name | Description |
|---|---|
Adf11 | Effective coefficients of one charge state from an ADAS adf11 file. |
Functions
| Name | Description |
|---|---|
lxcat_reactions | Return the excitation, ionization and attachment processes of an LXCat file. |
read_adf11 | Read one block (charge state) of an unresolved ADAS adf11 file. |
read_rate_table | Read 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
| Name | Type | Description |
|---|---|---|
density | np.ndarray | The electron densities in m^-3. |
temperature | np.ndarray | The electron temperatures in eV. |
coefficient | np.ndarray | The coefficients in m^3/s, shape (temperature, density). |
header | str | The first line of the file. |
coefficientattributeinstance attribute#
coefficient: np.ndarraydensityattributeinstance attribute#
density: np.ndarrayheaderattributeinstance attribute#
header: strtemperatureattributeinstance attribute#
temperature: np.ndarraylxcat_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
| Name | Type | Default | Description |
|---|---|---|---|
path | str | Path | required | The LXCat file. |
target | State | required | The target state of every process (e.g. Ar ground state). |
products | Callable[[str, str], tuple[State, ...] | None] | Mapping[str, tuple[State, ...]] | required | The 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. |
database | str | required | The database and its reference as the user’s download cites
it, e.g. "Biagi-v7.1, www.lxcat.net, retrieved 2026-10-27". |
retrieved | str | None | None | The download date (ISO 8601); today if not given. |
read_adf11function#
def read_adf11(path: str | Path, block: int = 0) -> Adf11Read 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.