49def doses_approx_equal(d1, d1_unc, d2, d2_unc, max_percent_diff=None, compare_unc=True, max_unc_percent_diff=None):
50 if max_percent_diff
is None:
51 max_percent_diff = max(d1_unc, d2_unc)
53 if max_unc_percent_diff
is None:
54 max_unc_percent_diff = 0.005
56 vc = values_close(d1, d2, max_percent_diff)
67 with open(fname,
'r')
as f:
70 nx, ny, nz = list(map(int, dat[0].strip().split()))
71 xbounds = list(map(float, dat[1].strip().split()))
72 ybounds = list(map(float, dat[2].strip().split()))
73 zbounds = list(map(float, dat[3].strip().split()))
74 doses = list(map(float, dat[4].strip().split()))
75 uncs = list(map(float, dat[5].strip().split()))
89def compare_3ddose_files(f1, f2, max_percent_diff=None):
94 bounds_keys = (
'xbounds',
'ybounds',
'zbounds',)
96 bounds_close = all([values_close(b1,b2)
for b1,b2
in zip(d1[k], d2[k])])
98 print((k,
" are different"))
101 doses_and_uncs = list(zip(d1[
'doses'], d1[
'uncs'], d2[
'doses'], d2[
'uncs']))
102 dose_diffs = [abs((a-b)/a)
for a,_,b,_
in doses_and_uncs]
104 doses_close = all([doses_approx_equal(d1, d1u, d2, d2u, max_percent_diff=max_percent_diff, compare_unc=
False)
105 for d1, d1u, d2, d2u
in doses_and_uncs])