Added tests for irregular MC

This commit is contained in:
Simon Kuberski 2021-10-28 18:07:09 +02:00
parent 9580a3a080
commit 0a4b5e07ca
2 changed files with 105 additions and 0 deletions

View file

@ -1254,12 +1254,17 @@ def covariance2(obs1, obs2, correlation=False, **kwargs):
idl_d = {}
r_length = []
for r_name in obs1.e_content[e_name]:
if r_name not in obs2.e_content[e_name]:
continue
idl_d[r_name] = merge_idx([obs1.idl[r_name], obs2.idl[r_name]])
if idl_d[r_name] is range:
r_length.append(len(idl_d[r_name]))
else:
r_length.append((idl_d[r_name][-1] - idl_d[r_name][0] + 1))
if not r_length:
return 0.
w_max = max(r_length) // 2
e_gamma[e_name] = np.zeros(w_max)