implement ensemble value mean for multiple snapshots

This commit is contained in:
Valentin Boettcher 2022-12-09 16:14:05 -05:00
parent 3890771074
commit e27e38b656
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -96,11 +96,14 @@ class EnsembleValue:
@property
def mean(self):
N, val, σ = self.final_aggregate
values = []
return EnsembleValue(
[(N, val.mean().copy(), np.sqrt((σ.copy() ** 2).sum() / val.size**2))]
)
for N, val, σ in self.aggregate_iterator:
values.append(
(N, val.mean().copy(), np.sqrt((σ.copy() ** 2).sum() / val.size**2))
)
return EnsembleValue(values)
@property
def max(self):