rizer.kin.load_cross_sections#
Classes#
Dataclass to handle cross section information for each reaction. |
Functions#
|
Load the yaml file containing the link between equation and alias for each database. |
|
|
|
Filter the cross section to load, after a deepcopy. |
|
Load cross section data. |
|
Group cross sections from various sources by equation. |
Module Contents#
- class rizer.kin.load_cross_sections.CrossSectionData#
Dataclass to handle cross section information for each reaction.
- rizer.kin.load_cross_sections.load_cross_sections_summary_yaml(path_to_cross_sections_yaml: pathlib.Path = get_path_to_data('kin', 'cross_section', 'cross_sections_summary.yaml')) dict[str, dict[str, dict[str, str]]]#
Load the yaml file containing the link between equation and alias for each database.
- Parameters:
path_to_cross_sections_yaml (
pathlib.Path, optional) – Path to yaml file. See ./data/kin/cross_section/cross_sections_summary.yaml for more.- Returns:
Example given:
# Name of the species, and the folder as well. {“H2”: # The reaction as it will appear in the kinetic scheme. {“e- + H2 => e- + e- + H2+”: # The name of the file/database, with the corresponding process name in that file. {“Biagi.txt”: “H2 -> +ionized H2”}}}
- Return type:
- rizer.kin.load_cross_sections.raise_type_error_on_isinstance(variable_to_test, expected_type, name_of_variable)#
- rizer.kin.load_cross_sections.filter_cross_sections_to_load(data: dict[str, dict[str, dict[str, str]]], species_to_keep: str | list[str] | None = None, species_to_remove: str | list[str] | None = None, equations_to_keep: str | list[str] | None = None, equations_to_remove: str | list[str] | None = None) dict[str, dict[str, dict[str, str]]]#
Filter the cross section to load, after a deepcopy.
Can be useful, to avoid loading all the data if only a subsection is required.
- Parameters:
data (
dictofstrtodictofstrtodictofstrtostr) – See load_cross_sections_summary_yaml.species_to_keep (
strorlistofstrorNone, optional) – Keep only the species provided, by default None. If None, keep all. If not None, cannot be set at the same time as species_to_remove.species_to_remove (
strorlistofstrorNone, optional) – Remove the species provided, by default None. If None, no species are removed. If not None, cannot be set at the same time as species_to_keep.equations_to_keep (
strorlistofstrorNone, optional) – Keep only the equation provided, by default None. If None, keep all. If not None, cannot be set at the same time as equations_to_remove.equations_to_remove (
strorlistofstrorNone, optional) – Remove the equation provided, by default None. If None, no equation are removed If not None, cannot be set at the same time as equations_to_keep.
- Returns:
See load_cross_sections_summary_yaml.
- Return type:
- rizer.kin.load_cross_sections.load_cross_sections_data(data: dict[str, dict[str, dict[str, str]]]) list[CrossSectionData]#
Load cross section data.
Parsing is done using rizer.io.lxcat.LXCat class.
- rizer.kin.load_cross_sections.group_cross_sections_by_equation(cross_section_list: list[CrossSectionData]) dict[str, list[CrossSectionData]]#
Group cross sections from various sources by equation.
- Parameters:
cross_section_list (
listofCrossSectionData) – List containing CrossSectionData. Typically generated by load_cross_sections_data.- Returns:
Dictionnary where equation are mapped to corresponding list of CrossSectionData.
- Return type:
dictofstrtolistofCrossSectionData