spyrit.misc.sampling.reorder

spyrit.misc.sampling.reorder(meas: ndarray, Perm_acq: ndarray, Perm_rec: ndarray) ndarray[source]

Reorder measurement vectors

Args:
meas (np.ndarray):

Measurements with dimensions (\(M_{acq} \times K_{rep}\)), where \(M_{acq}\) is the number of acquired patterns and \(K_{rep}\) is the number of acquisition repetitions (e.g., wavelength or image batch).

Perm_acq (np.ndarray):

Permutation matrix used for acquisition (\(N_{acq}^2 \times N_{acq}^2\) square matrix).

Perm_rec (np.ndarray):

Permutation matrix used for reconstruction (\(N_{rec} \times N_{rec}\) square matrix).

Returns:
(np.ndarray):

Measurements with dimensions (\(M_{rec} \times K_{rep}\)), where \(M_{rec} = N_{rec}^2\).

Note

If \(M_{rec} < M_{acq}\), the input measurement vectors are subsampled.

If \(M_{rec} > M_{acq}\), the input measurement vectors are filled with zeros.