SpharmPdmData#

class ktch.io.SpharmPdmData(specimen_name: str, coeffs: list[ndarray])[source]#

SPHARM-PDM coefficient data for a single specimen.

Stores spherical harmonic coefficients in the nested list format where coeffs[l] has shape (2*l+1, 3) for degree l.

Parameters:
specimen_namestr

Specimen name.

coeffslist of np.ndarray

Nested list of complex128 coefficient arrays. coeffs[l] has shape (2*l+1, 3) for degree l.

property l_max: int#

Maximum spherical harmonic degree.

property n_degrees: int#

Number of spherical harmonic degrees (l_max + 1).

to_dataframe() DataFrame[source]#

Return coefficients as a DataFrame.

Returns:
dfpd.DataFrame

DataFrame with columns x, y, z. Index is a MultiIndex (specimen_id, (l, m)).

to_numpy() ndarray[source]#

Return flat coefficient array.

Returns:
coeffsnp.ndarray of shape ((l_max+1)^2, 3), complex128

Concatenated coefficient matrix.