NefData#
- class ktch.io.NefData(specimen_name: str, coeffs: ndarray, const_flags: tuple[int, int, int, int] = (1, 1, 1, 0))[source]#
Normalized elliptic Fourier descriptor data.
Stores the normalized EFD coefficients produced by SHAPE’s Chc2Nef program. Each harmonic n has four coefficients (a_n, b_n, c_n, d_n).
- Parameters:
- specimen_namestr
Specimen name (e.g.
"Sample1_1").- coeffsnp.ndarray
Coefficient matrix with shape
(n_harmonics, 4). Columns are[a, b, c, d]for each harmonic (1 .. n).- const_flagstuple of int
Four flags indicating which first-harmonic coefficients are constant after normalization.
(1, 1, 1, 0)for first-ellipse normalization (a1=1, b1=0, c1=0, d1 varies).
- classmethod from_efa_coeffs(coeffs, specimen_name='')[source]#
Create NefData from a 2D EFA flat coefficient vector.
- Parameters:
- coeffsnp.ndarray of shape (n_features,)
Flat EFA coefficient vector (with or without orientation/scale).
- specimen_namestr
Specimen name for the record.
- Returns:
- nef_dataNefData
- property n_harmonics#
Number of harmonics.