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, **kwargs)#
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, energy_levels, cross_sections)#
Bases:
object
A class of YAML data for collision of a target species
- classmethod to_yaml(representer, node)#
- 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()#
- cantera.lxcat2yaml.get_children(parent, child_name)#
- cantera.lxcat2yaml.registerProcess(process: Element, process_list: List[Process], gas: Solution)#
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