mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
1da8d9183e
2 changed files with 14 additions and 3 deletions
|
@ -278,7 +278,7 @@ class Obs:
|
|||
|
||||
def _compute_drho(i):
|
||||
tmp = (self.e_rho[e_name][i + 1:w_max]
|
||||
+ np.concatenate([self.e_rho[e_name][i - 1:None if i - w_max // 2 <= 0 else 2 * (i - w_max // 2):-1],
|
||||
+ np.concatenate([self.e_rho[e_name][i - 1:None if i - w_max // 2 <= 0 else (2 * i - (2 * w_max) // 2):-1],
|
||||
self.e_rho[e_name][1:max(1, w_max - 2 * i)]])
|
||||
- 2 * self.e_rho[e_name][i] * self.e_rho[e_name][1:w_max - i])
|
||||
self.e_drho[e_name][i] = np.sqrt(np.sum(tmp ** 2) / e_N)
|
||||
|
|
|
@ -762,11 +762,22 @@ def test_gamma_method_irregular():
|
|||
N = 15
|
||||
for i in range(10):
|
||||
arr = np.random.normal(1, .2, size=N)
|
||||
for rho in .1 * np.arange(20):
|
||||
for rho in .05 * np.arange(20):
|
||||
carr = gen_autocorrelated_array(arr, rho)
|
||||
a = pe.Obs([carr], ['a'])
|
||||
a.gm()
|
||||
|
||||
arr = np.random.normal(1, .2, size=999)
|
||||
carr = gen_autocorrelated_array(arr, .8)
|
||||
o = pe.Obs([carr], ['test'])
|
||||
o.gamma_method()
|
||||
no = np.NaN * o
|
||||
no.gamma_method()
|
||||
o.idl['test'] = range(1, 1998, 2)
|
||||
o.gamma_method()
|
||||
no = np.NaN * o
|
||||
no.gamma_method()
|
||||
|
||||
|
||||
def test_irregular_gapped_dtauint():
|
||||
my_idl = list(range(0, 5010, 10))
|
||||
|
@ -1096,7 +1107,7 @@ def test_reduce_deltas():
|
|||
for idx_new in idl:
|
||||
new = pe.obs._reduce_deltas(deltas, idx_old, idx_new)
|
||||
print(new)
|
||||
assert(np.alltrue([float(i) for i in idx_new] == new))
|
||||
assert(np.all([float(i) for i in idx_new] == new))
|
||||
|
||||
|
||||
def test_cobs_array():
|
||||
|
|
Loading…
Add table
Reference in a new issue