write_spharmpdm_coef#
- ktch.io.write_spharmpdm_coef(path: str | Path, data: SpharmPdmData, precision: int | None = None) None[source]#
Write SPHARM coefficients to a SPHARM-PDM
.coeffile.The inverse of
read_spharmpdm_coef(). The file layout matches the output ofParaToSPHARMMeshin SPHARM-PDM: the number of coefficients per coordinate, then one{x, y, z}triple per line in SPHARM-PDM’s interleaved real/imaginary order.- Parameters:
- pathstr or pathlib.Path
Path of the
.coeffile to write.- dataSpharmPdmData
SPHARM-PDM coefficient data for a single specimen.
- precisionint, optional
Number of decimals to write.
Nonewrites the shortest representation that reads back to the samefloat64. SPHARM-PDM itself writes six decimals; passprecision=6to reproduce that format.
- Raises:
- ValueError
If
datais not aSpharmPdmDataor its coefficients are malformed.- IOError
If the file cannot be written.
See also
read_spharmpdm_coefRead a
.coeffile.sha_coeffs_to_spharmpdmConvert ktch coefficient vectors for writing.