cp2kdata.utils module
this module sotres misc functions
-
cp2kdata.utils.create_path(path)[source]
-
cp2kdata.utils.file_content(file, num)[source]
-
cp2kdata.utils.find_closet_idx_by_value(arr: ndarray[Any, dtype[ScalarType]], value: Any) → int[source]
Find the index of the closest value in the given array to the specified value.
Parameters:
arr (numpy.ndarray): The input array.
value (Any): The value to find the closest index for.
Returns:
int: The index of the closest value in the array.
-
cp2kdata.utils.format_logger(info, filename)[source]
-
cp2kdata.utils.get_rdf(pos, r, nbin, frames, elements)[source]
-
cp2kdata.utils.get_rdf_list(pos, r, nbin, frames, elements)[source]
pos: a list of atoms object
r: the radial length
nbin: the bin number in the radial range
frames: how much pos number will you consider
elements: the atom pair
-
cp2kdata.utils.interpolate_spline(old_x, old_y, new_x)[source]
-
cp2kdata.utils.set_pbc(pos, cell)[source]
set pbc for a list of Atoms object