Commit 39b8cabd authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'minimization_sanity' into 'NIFTy_7'

Minimization sanity improvements

See merge request !586
parents bca74a59 d4f1f2b4
Pipeline #88094 passed with stages
in 11 minutes and 43 seconds
......@@ -460,7 +460,7 @@ def _comp_chisq(op, energy, keylen):
mean = {kk: StatCalculator() for kk in keys}
ndof = {}
for ii, ss in enumerate(s):
rr = op(p + ss)
rr = op.force(p.unite(ss))
for kk in keys:
redchisq[kk].add(np.nansum(abs(rr[kk].val) ** 2) / rr[kk].size)
mean[kk].add(np.nanmean(rr[kk].val))
......@@ -476,9 +476,9 @@ def _comp_chisq(op, energy, keylen):
foo += f" ± {np.sqrt(redchisq[kk].var):.1f}"
except RuntimeError:
pass
if redchisq[kk].mean > 5:
if redchisq[kk].mean > 5 or redchisq[kk].mean < 1/5:
out += _bcolors.FAIL + _bcolors.BOLD + f"{foo:>11}" + _bcolors.ENDC
elif redchisq[kk].mean > 2:
elif redchisq[kk].mean > 2 or redchisq[kk].mean < 1/2:
out += _bcolors.WARNING + _bcolors.BOLD + f"{foo:>11}" + _bcolors.ENDC
else:
out += f"{foo:>11}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment