radtools.load_poscar#
- radtools.load_poscar(file_object=None, return_crystal=True, return_comment=False)[source]#
Read the crystal structure from the POSCAR file.
- Parameters:
- file_object: str of file-like object, optional
File to be read. If str, then file is opened with the given name. Otherwise it has to have
.readlines()method. By default it looks for the "POSCAR" file in the current directory. Behaviour forstr:Tries to open the file with the name given by the
file_object.Tries to open the file with the name "POSCAR" in the directory given by the
file_object.
- return_crystal: bool, default True
If True, returns
Crystalobject. Otherwise returns a tuple of(cell, atoms).- return_comment: bool, default False
Whether to return the comment from the first line of the file.
- Returns:
- crystal:
Crystal Crystal structure read from the file. If
return_crystalisTrue.- cell: (3, 3) numpy.ndarray
Cell of the crystal structure. If
return_crystalisFalse.- atoms: list of
Atom Atoms of the crystal structure. If
return_crystalisFalse. Positions are always relative to the cell.- comment: str
Comment from the first line of the file. If
return_commentisTrue.
- crystal: