LXCat to YAML conversion#

Module-level documentation#

lxcat2yaml.py: Convert the LXCat integral cross-section data in XML format to YAML format. The cross-section data is used to calculate the reaction rate of a electron-collision process in a plasma. The data can be downloaded at https://nl.lxcat.net/data/download.php.

Usage:
lxcat2yaml [–input=<filename>]

[–database=<database name>] [–mech=<filename>] [–phase=<phase name>] [–insert] [–output=<filename>]

Example:
lxcat2yaml –input=mycs.xml –database=itikawa –mech=oxygen-plasma.yaml

–phase=isotropic-electron-energy-plasma –insert –output=oxygen-itikawa-plasma.yaml

cantera.lxcat2yaml.Flowlist(*args: Iterable[_VT], **kwargs: _VT) list[_VT]#

A YAML sequence that flows onto one line.

exception cantera.lxcat2yaml.IncorrectXMLNode(message: str = '', node: Element | None = None)#

Bases: LookupError

Error raised when a required node is incorrect in the XML tree.

Parameters:
  • message – The error message to be displayed to the user.

  • node – The XML node from which the requested node is incorrect.

class cantera.lxcat2yaml.Process(equation: str, energy_levels: list[float], cross_sections: list[float])#

Bases: object

A class of YAML data for collision of a target species

classmethod to_yaml(representer: SafeRepresenter, node: Process) MappingNode#
cantera.lxcat2yaml.convert(inpfile: str | Path | None = None, database: str | None = None, mechfile: str | None = None, phase: str | None = None, insert: bool | None = True, outfile: str | Path | None = None) None#

Convert an LXCat XML file to a YAML file.

Parameters:
  • inpfile – The input LXCat file name.

  • database – The name of the database. For example, “itikawa”.

  • mechfile – The reaction mechanism file. This option requires using the Cantera library.

  • phase – The phase name of the mechanism file. This option requires a mechfile to also be specified.

  • insert – The flag of whether to insert the collision reactions or not.

  • outfile – The output YAML file name.

All files are assumed to be relative to the current working directory of the Python process running this script.

cantera.lxcat2yaml.create_argparser() ArgumentParser#
cantera.lxcat2yaml.get_children(parent: etree.Element[str], child_name: str) list[etree.Element[str]]#
cantera.lxcat2yaml.main(argv: Sequence[str] | None = None) None#

Parse command line arguments and pass them to convert.

cantera.lxcat2yaml.registerProcess(process: Element, process_list: list[Process] | None, gas: Solution | None) None#

Add a collision process (electron collision reaction) to process_list and gas object if it exists.

Parameters:
  • process – The collision process (electron collision reaction)

  • process_list – The list of collision processes

  • gas – The Cantera Solution object