Merge branch 'develop' into documentation

This commit is contained in:
fjosw 2023-05-31 15:59:46 +00:00
commit 50594cb968
3 changed files with 3 additions and 3 deletions

View file

@ -42,7 +42,7 @@ class Covobs:
def errsq(self): def errsq(self):
""" Return the variance (= square of the error) of the Covobs """ Return the variance (= square of the error) of the Covobs
""" """
return float(np.dot(np.transpose(self.grad), np.dot(self.cov, self.grad))) return np.dot(np.transpose(self.grad), np.dot(self.cov, self.grad)).item()
def _set_cov(self, cov): def _set_cov(self, cov):
""" Set the covariance matrix of the covobs """ Set the covariance matrix of the covobs

View file

@ -850,7 +850,7 @@ def create_dobs_string(obsl, name, spec='dobs v1.0', origin='', symbol=[], who=N
for i in range(ncov): for i in range(ncov):
for o in obsl: for o in obsl:
if cname in o.covobs: if cname in o.covobs:
val = o.covobs[cname].grad[i] val = o.covobs[cname].grad[i].item()
if val != 0: if val != 0:
ds += '%1.14e ' % (val) ds += '%1.14e ' % (val)
else: else:

View file

@ -1521,7 +1521,7 @@ def _covariance_element(obs1, obs2):
if e_name not in obs2.cov_names: if e_name not in obs2.cov_names:
continue continue
dvalue += float(np.dot(np.transpose(obs1.covobs[e_name].grad), np.dot(obs1.covobs[e_name].cov, obs2.covobs[e_name].grad))) dvalue += np.dot(np.transpose(obs1.covobs[e_name].grad), np.dot(obs1.covobs[e_name].cov, obs2.covobs[e_name].grad)).item()
return dvalue return dvalue