sha_coeffs_to_spharmpdm#

ktch.io.sha_coeffs_to_spharmpdm(coeffs, specimen_names=None)[source]#

Convert SHA flat coefficient vectors to SpharmPdmData objects.

The input should contain real-valued coefficients from SphericalHarmonicAnalysis. The output SpharmPdmData.coeffs uses complex coefficients matching the SPHARM-PDM convention.

Parameters:
coeffsnp.ndarray of shape (n_samples, 3 * (l_max + 1)**2)

Flat SHA coefficient vectors from transform().

specimen_nameslist of str, optional

Specimen names. Defaults to "Specimen_0", "Specimen_1", etc.

Returns:
spharmpdm_listlist of SpharmPdmData

One SpharmPdmData per sample.

Raises:
ValueError

If the coefficient vector length is not divisible by 3 or the per-axis count is not a perfect square.