Skip to content
Snippets Groups Projects
Commit 0d0e5948 authored by Arin Wongprommoon's avatar Arin Wongprommoon Committed by Alán Muñoz
Browse files

Cross-corr process computes std dev over time for each replicate

parent dd478bbe
No related branches found
No related tags found
No related merge requests found
...@@ -58,15 +58,17 @@ class crosscorr(PostProcessABC): ...@@ -58,15 +58,17 @@ class crosscorr(PostProcessABC):
trace_A = trace_dfA.to_numpy() trace_A = trace_dfA.to_numpy()
# number of time points # number of time points
n_tps = trace_A.shape[1] n_tps = trace_A.shape[1]
# number of replicates
n_replicates = trace_A.shape[0]
# deviation from mean at each time point # deviation from mean at each time point
dmean_A = trace_A - np.nanmean(trace_A, axis=0).reshape((1, n_tps)) dmean_A = trace_A - np.nanmean(trace_A, axis=0).reshape((1, n_tps))
# standard deviation at each time point # standard deviation over time for each replicate
stdA = np.sqrt(np.nanmean(dmean_A ** 2, axis=0).reshape((1, n_tps))) stdA = np.sqrt(np.nanmean(dmean_A ** 2, axis=1).reshape((n_replicates, 1)))
if trace_dfB is not None: if trace_dfB is not None:
trace_B = trace_dfB.to_numpy() trace_B = trace_dfB.to_numpy()
# cross correlation # cross correlation
dmean_B = trace_B - np.nanmean(trace_B, axis=0).reshape((1, n_tps)) dmean_B = trace_B - np.nanmean(trace_B, axis=0).reshape((1, n_tps))
stdB = np.sqrt(np.nanmean(dmean_B ** 2, axis=0).reshape((1, n_tps))) stdB = np.sqrt(np.nanmean(dmean_B ** 2, axis=1).reshape((n_replicates, 1)))
else: else:
# auto correlation # auto correlation
dmean_B = dmean_A dmean_B = dmean_A
......
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