Skip to content
Snippets Groups Projects
Unverified Commit 1f1b248b authored by mashatarasevich's avatar mashatarasevich Committed by GitHub
Browse files

Added minimal Python example

parent a9e4e2ef
No related branches found
No related tags found
No related merge requests found
import numpy as np
from supersvd import supersvd
import matplotlib.pyplot as plt
ts = np.fromfile('ts.std', dtype=np.float32).reshape(1147, 28, 31)
ps = np.fromfile('ps.std', dtype=np.float32).reshape(1147, 28, 31)
svd = supersvd(ts, ps, 4)
first_mode_ts = svd.x_vect[0]
plt.matshow(first_mode_ts)
plt.savefig('first_mode_ts.png')
first_ps_timeseries = svd.x_coeff[0]
plt.figure()
plt.plot(first_ps_timeseries)
plt.savefig('first_ps_timeseries.png')
print('Correlation coefficient between first_ts_timeseries. and first_ps_timeseries:', svd.corrcoeff[0])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment