ctf4science.eval_module.compute_log_psd#

ctf4science.eval_module.compute_log_psd(array: ndarray, k: int, modes: int) ndarray#

Compute the natural log of the averaged PSD over the last k time steps.

Calls compute_psd and returns log(psd + 1e-10) to avoid log(0). See compute_psd for the PSD calculation.

Parameters:
array(T, S) ndarray

Data with shape (time_steps, spatial_points).

kint

Number of last time steps to average over.

modesint

Number of Fourier modes from the center frequency.

Returns:
ndarray

Averaged log-PSD for the specified modes, shape (modes,).

Raises:
ValueError

If k exceeds time_steps or modes exceeds spatial_points.