You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pyLOM/POD/wrapper.pyx
+31-30
Original file line number
Diff line number
Diff line change
@@ -135,17 +135,19 @@ def _drun(double[:,:] X, int remove_mean, int randomized, int r, int q, int seed
135
135
@cython.nonecheck(False)
136
136
@cython.cdivision(True) # turn off zero division check
137
137
defrun(real[:,:] X, int remove_mean=True, int randomized=False, const int r=1, const int q=3, const int seed=-1):
138
-
'''
139
-
Run POD analysis of a matrix X.
138
+
r'''
139
+
Run POD analysis of a matrix.
140
140
141
-
Inputs:
142
-
- X[ndims*nmesh,n_temp_snapshots]: data matrix
143
-
- remove_mean: whether or not to remove the mean flow
141
+
Args:
142
+
X (np.ndarray): data matrix of size [ndims*nmesh,n_temp_snapshots].
143
+
remove_mean (bool, optional): whether or not to remove the mean flow (default: ``True``).
144
+
randomized (bool, optional): whether to perform randomized POD or not (default: ``False``).
145
+
r (int, optional): in case of performing randomized POD, how many modes do we want to recover. This option has no effect when randomized=False (default: ``1``).
146
+
q (int, optional): in case of performing randomized POD, how many power iterations are performed. This option has no effect when randomized=False (default: ``3``).
147
+
seed (int, optional): seed for reproducibility of randomized operations. This option has no effect when randomized=False (default: ``-1``).
144
148
145
149
Returns:
146
-
- U: are the POD modes.
147
-
- S: are the singular values.
148
-
- V: are the right singular vectors.
150
+
[(np.ndarray), (np.ndarray), (np.ndarray)]: POD spatial modes (left singular vectors), singular values and temporal coefficients (right singular vectors).
- npwin: number of points in each window (0 will set default value: ~10% nt)
440
-
- nolap: number of overlap points between windows (0 will set default value: 50% nwin)
441
-
- remove_mean: whether or not to remove the mean flow
436
+
Args:
437
+
X (np.ndarray): data matrix.
438
+
t (np.ndarray): times at which the snapshots of X were collected
439
+
nDFT (int, optional): number of points in each window (0 will set default value: ~10% nt)
440
+
nolap (int, optional): number of overlap points between windows (0 will set default value: 50% nwin)
441
+
remove_mean (bool, optional): whether or not to remove the mean flow (default, ``True``)
442
442
443
443
Returns:
444
-
- L: modal energy spectra.
445
-
- P: SPOD modes, whose spatial dimensions are identical to those of X.
446
-
- f: frequency vector.
444
+
[(np.ndarray), (np.ndarray), (np.ndarray)]: where the first array is L, the modal energy spectra, the second array is P, SPOD modes, whose spatial dimensions are identical to those of X and finally f is the frequency vectors
0 commit comments