aim2dat.io¶
Subpackage containing functions to read or write files.
Functions¶
|
Read cif file. |
|
Read band structure file from CP2K. |
|
Read the atom projected density of states from CP2K. |
|
Read structures from 'restart'-files. |
|
Read standard output file of CP2K. |
|
Read output plane file. |
|
Read standard output file. |
|
Read band structure files from FHI-aims. |
|
Read the atom projected density of states from FHI-aims. |
|
Read the total density of states from FHI-aims. |
|
Read hdf5 structure file. |
|
Read band structure using phonopy. |
|
Read the atom projected density of phonon states from phonopy. |
|
Read the outputs from a quasi-harmonic approximation calculation. |
|
Read the thermal properties from phonopy. |
|
Read the total density of phonon states from phonopy. |
|
Read band structure file from Quantum ESPRESSO. |
|
Read structure from the Quantum ESPRESSO input file. |
|
Read the projected density of states from Quantum ESPRESSO. |
|
Read the total density of states from Quantum ESPRESSO. |
|
Read xml output file. |
|
Read xmgrace band structure file. |
|
Read xmgrace plot filies. |
|
Load a yaml-file and returns the content. |
|
Write a list of structures to file. |
|
Write content to a yaml-file. |
|
Write structure dictonaryto an input file for zeo++. |
Package Contents¶
-
aim2dat.io.read_cif_file(file_path: str, extract_structures: bool =
False, strct_check_chem_formula: bool =True, strct_get_sym_op_from_sg: bool =True, strct_wrap: bool =False) dict[source]¶ Read cif file.
- Parameters:¶
file_path (str) – Path to the cif file.
extract_structures (bool (optional)) – Whether to extract alls crystal structures and add them to the output dictionary with the key
'structures'.strct_check_chem_formula (bool (optional)) – Check the chemical formula given by field matches with the structure.
strct_get_sym_op_from_sg (bool (optional)) – Add symmetry operations based on the space group to add symmetry equivalent sites to the structures.
- Returns:¶
dict – Output dictionary.
- aim2dat.io.read_cp2k_band_structure(file_path: str) dict[source]¶
Read band structure file from CP2K.
- aim2dat.io.read_cp2k_proj_dos(folder_path: str) dict[source]¶
Read the atom projected density of states from CP2K.
- aim2dat.io.read_cp2k_restart_structure(folder_path: str) dict | list[dict][source]¶
Read structures from ‘restart’-files.
- Parameters:¶
folder_path (str) – Path to the folder containing the CP2K output-files.
- Returns:¶
dict or list – Dictionary or list of dictionaries containing the structural information. In case of a farming job or several calculations have been run in the same folder, a list of dictionaries is returned.
-
aim2dat.io.read_cp2k_stdout(file_path: str, parser_type: str =
'standard', raise_error: bool =True) dict[source]¶ Read standard output file of CP2K.
- Parameters:¶
file_path (str) – Path to the output file.
parser_type (str) – Defines the quantities that are being parsed. Supported options are
'standard','partial_charges'and'trajectory'.raise_error (bool) – Whether to raise an error if a flaw is detected in the output file.
- Returns:¶
dict – Dictionary containing the parsed values.
-
aim2dat.io.read_critic2_stdout(file_path: str, raise_error: bool =
True) dict[source]¶ Read standard output file.
-
aim2dat.io.read_fhiaims_band_structure(folder_path: str, soc: bool =
False) dict[source]¶ Read band structure files from FHI-aims. Spin-polarized calculations are not yet supported.
-
aim2dat.io.read_fhiaims_proj_dos(folder_path: str, soc: bool =
False, load_raw: bool =False) dict[source]¶ Read the atom projected density of states from FHI-aims.
- Parameters:¶
folder_path (str) – Path to the folder of the pdos files or list of pdos files or path to a pdos file.
soc (bool (optional)) – Whether spin-orbit coupling is activated. The default value is
False.load_raw (bool (optional)) – Load files with appendix ‘raw’. The default value is
False.
- Returns:¶
pdos (dict) – Dictionary containing the projected density of states for each atom.
- aim2dat.io.read_fhiaims_total_dos(file_path: str) dict[source]¶
Read the total density of states from FHI-aims.
-
aim2dat.io.read_phonopy_band_structure(file_path: str, kpath: list, npoints: int, force_sets_file_path: str =
None, force_constants_file_path: str =None, path_labels: list =None, phonopy_kwargs: dict =None) tuple[dict, list][source]¶ Read band structure using phonopy.
- Parameters:¶
file_path (str) – Phonopy yaml-file containing all settings and parameters.
kpath (list) – Nested list of high-symmetry points.
npoints (int) – Nr of points on the k-path.
force_sets_file_path (str or None) – Force sets file. If set to
None,force_constants_file_pathneeds to be set.force_constants_file_path (str or None) – Force constants file. If set to
None,force_sets_file_pathneeds to be set.path_labels (list or None) – List of labels for the high-symmetry points specified in
kpath.phonopy_kwargs (dict) – Additional keywords for
phonopy.load.
- Returns:¶
output_bands (dict) – Dictionary containing the k-path and the eigenvalues.
reference_cell (list) – Reference cell.
-
aim2dat.io.read_phonopy_proj_dos(file_path: str, mesh: int | list =
100, force_sets_file_path: str =None, force_constants_file_path: str =None, phonopy_kwargs: dict =None) dict[source]¶ Read the atom projected density of phonon states from phonopy.
- Parameters:¶
file_path (str) – Phonopy yaml-file containing all settings and parameters.
mesh (list) – Number of points in each dimension.
force_sets_file_path (str or None) – Force sets file. If set to
None,force_constants_file_pathneeds to be set.force_constants_file_path (str or None) – Force constants file. If set to
None,force_sets_file_pathneeds to be set.phonopy_kwargs (dict) – Additional keywords for
phonopy.load.
- Returns:¶
dict – Dictionary containing the projected density of states for each kind.
-
aim2dat.io.read_phonopy_qha_properties(calculation_folder_paths: list =
None, thermal_properties_file_paths: list =None, ev_file_path: str =None, stdout_file_path: str =None, mesh: int | list =100, t_min: int =0, t_max: int =1000, t_step: int =10, phonopy_kwargs: dict =None)[source]¶ Read the outputs from a quasi-harmonic approximation calculation.
- Parameters:¶
calculation_folder_paths (list or None) – Folders containing the calculations of different volumes. If
Nonethermal_properties_file_pathsneeds to be set instead.thermal_properties_file_paths (list or None) – List of thermal properties yaml files generated by phonopy.
thermal_properties_file_paths (str or None) – File containing volumes and energies.
ev_file_path (str or None) – Path to the e-V file.
stdout_file_path (str or None) – File name of the standard output file.
mesh (list or int) – Number of points in each dimension.
t_min (int) – Minimum temperature
t_max (int) – Maximum temperature
phonopy_kwargs (dict) – Additional keywords for
phonopy.load.
- Returns:¶
dict – Dictionary containing the qha properties.
-
aim2dat.io.read_phonopy_thermal_properties(file_path: str, mesh: int | list =
100, t_min: int =0, t_max: int =1000, t_step: int =10, force_sets_file_path: str =None, force_constants_file_path: str =None, phonopy_kwargs: dict =None)[source]¶ Read the thermal properties from phonopy.
- Parameters:¶
file_path (str) – Phonopy yaml-file containing all settings and parameters.
mesh (list) – Number of points in each dimension.
t_min (int) – Minimum temperature
t_max (int) – Maximum temperature
force_sets_file_path (str or None) – Force sets file. If set to
None,force_constants_file_pathneeds to be set.force_constants_file_path (str or None) – Force constants file. If set to
None,force_sets_file_pathneeds to be set.phonopy_kwargs (dict) – Additional keywords for
phonopy.load.
- Returns:¶
dict – Dictionary containing the thermal properties.
-
aim2dat.io.read_phonopy_total_dos(file_path: str, mesh: int | list =
100, force_sets_file_path: str =None, force_constants_file_path: str =None, phonopy_kwargs: dict =None) dict[source]¶ Read the total density of phonon states from phonopy.
- Parameters:¶
file_path (str) – Phonopy yaml-file containing all settings and parameters.
mesh (list) – Number of points in each dimension.
force_sets_file_path (str or None) – Force sets file. If set to
None,force_constants_file_pathneeds to be set.force_constants_file_path (str or None) – Force constants file. If set to
None,force_sets_file_pathneeds to be set.phonopy_kwargs (dict) – Additional keywords for
phonopy.load.
- Returns:¶
dict – Dictionary containing the total density of states.
- aim2dat.io.read_qe_band_structure(file_path: str) dict[source]¶
Read band structure file from Quantum ESPRESSO. Spin-polarized calculations are not yet supported.
- aim2dat.io.read_qe_input_structure(file_path: str) dict[source]¶
Read structure from the Quantum ESPRESSO input file. ibrav parameters are not yet fully supported.
- aim2dat.io.read_qe_proj_dos(folder_path)[source]¶
Read the projected density of states from Quantum ESPRESSO.
- aim2dat.io.read_qe_total_dos(file_path: str) dict[source]¶
Read the total density of states from Quantum ESPRESSO.
-
aim2dat.io.read_qe_xml(file_path: str, extract_structures: bool =
False, strct_type: str =None, strct_include: list =None, raise_error: bool =True) dict[source]¶ Read xml output file.
- Parameters:¶
file_path (str) – Path of the xml-file of Quantum ESPRESSO.
extract_structures (bool) – Whether to extract alls crystal structures and add them to the output dictionary with the key
'structures'.strct_type (str) – Type of extracted structure(s). Supported options are
'input','output'or'steps'.strct_include (list) – List of dictionary keys that are included in the structure attributes.
raise_error (bool) – Whether to raise an error if a flaw is detected in the output file.
- Returns:¶
dict – Output dictionary.
- aim2dat.io.read_xmgrace_band_structure(file_path: str, kpoints: list) list[source]¶
Read xmgrace band structure file.
- aim2dat.io.read_xmgrace_file(file_path: str) list | tuple[source]¶
Read xmgrace plot filies.
Up to now the functionality is very limited. xy-data is read and grouped by the line-color.
Notes
TODO: Increase functionality and generality.
-
aim2dat.io.read_yaml_file(file_path: str, typ: str =
'safe')[source]¶ Load a yaml-file and returns the content.
- aim2dat.io.write_hdf5_structure(file_path: str, structures: list[aim2dat.strct.structure.Structure])[source]¶
Write a list of structures to file.
- Parameters:¶
file_path (str) – Path to hdf5 file.
structures (list) – List of structures.
- aim2dat.io.write_yaml_file(file_path: str, content)[source]¶
Write content to a yaml-file.
- Parameters:¶
file_path (str) – Path to the yaml-file.
content – Content of the file.
- aim2dat.io.write_zeo_file(file_path: str, struct_dict: dict)[source]¶
Write structure dictonaryto an input file for zeo++.