radn-dev/xmetrics/x_proportional.py

11 lines
229 B
Python

import pickle
import numpy as np
with open("Y.dat", "rb") as file:
Y = pickle.load(file)
N = Y.shape[1]
X = abs(np.diff(Y, axis=1, prepend=0)).sum(axis=0).cumsum()
with open("X.dat", "wb") as file:
pickle.dump(X, file)