read_spharmpdm_coef#

ktch.io.read_spharmpdm_coef(path: str | Path) List[ndarray[tuple[Any, ...], dtype[complex128]]][source]#

Read .coef file of SPHARM-PDM. The .coef file is an output of the ParaToSPHARMMesh step of SPHARM-PDM, and contains SPHARM coefficients.

The file format consists of: - First value: total number of coefficients (3*(lmax+1)^2) - Remaining values: real and imaginary parts of coefficients

arranged in SPHARM-PDM’s specific order

Parameters:
pathstr or pathlib.Path

Path to the .coef file.

Returns:
coefList[npt.NDArray[np.complex128]]

List of numpy arrays containing SPHARM coefficients for each coordinate.

Raises:
FileNotFoundError

If the file does not exist.

ValueError

If the file format is invalid or coefficients are malformed.