Commit 1cff8a3b authored by Aaron Jones's avatar Aaron Jones

Fixed bug between finesse2 and 3

parent b8d66bdd
......@@ -132,7 +132,17 @@ def diff(katfile,finesse3=False):
# for computing relative errors we need to make sure we
# have no zeros in the data
nzix = (ref_arr != 0)
nzix = np.logical_and((ref_arr != 0),(out_arr != 0))
# ABOVE HEREBE DRAGONS -> this out_arr != 0 could miss some points
# because it does not check that ref_arr < diff_rel_eps for
# cases where out_arr == 0. But this is likely to be few cases
# It was introduced to solve issues where ref_arr != 0 but
# out_arr = 0 which then introduced a rel_diff of one.
# This isn't wrong but causes problems when comparing xaxis
# between finesse3 and finesse2. This could probably be solved
# by splitting them out into different variables and testing each
# case individually, but this is somewhat overengineering a simple
# problem.
rel_diff = np.abs(out_arr-ref_arr)
# only compute rel diff for non zero values
......
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