3.1.2.17. opengate.helpers_tests

3.1.2.17.1. Module Contents

3.1.2.17.1.1. Functions

test_ok([is_ok])

delete_run_manager_if_needed(sim)

read_stat_file(filename)

print_test(b, s)

assert_stats(stat1, stat2[, tolerance, is_ok])

plot_img_axis(ax, img, label[, axis])

plot_img_z(ax, img, label)

plot_img_y(ax, img, label)

plot_img_x(ax, img, label)

assert_images(ref_filename1, filename2[, stats, ...])

exponential_func(x, a, b)

Gauss(x, A, x0, sigma)

fit_exponential_decay(data, start, end)

get_new_key_name(key)

get_keys_correspondence(keys)

rel_diff(a, b)

rel_diff_range(a, b)

get_branch(tree, keys, key)

Return a branch whether it is a numpy or a uproot tree

compare_branches(tree1, keys1, tree2, keys2, key1, key2)

Compare with Wasserstein distance

compare_branches_values(b1, b2, key1, key2[, tol, ax, ...])

Compare with Wasserstein distance

compare_trees(tree1, allkeys1, tree2, allkeys2, keys1, ...)

get_default_test_paths(f[, gate_folder])

compare_root2(root1, root2, branch1, branch2, keys, ...)

compare_root(root1, root2, branch1, branch2, ...)

compare_root3(root1, root2, branch1, branch2, keys1, ...)

dict_compare(d1, d2)

write_gauss_param_to_file(outputdir, planePositionsV)

get_gauss_param_xy(data, spacing, shape[, filepath, ...])

extract_gauss_param_1D(data, length, spacing[, axis, ...])

plot_gauss_fit(positionVec, dose, fit[, show])

create_position_vector(length, spacing)

Gauss(x, A, x0, sigma)

gaussian_fit(positionVec, dose)

read_mhd(filename)

create_2D_Edep_colorMap(filepath[, show])

compareGaussParamFromFile(sigma, ref[, rel_tol, ...])

compareGaussParamArrays(paramTestV, paramRefV[, ...])

test_weights(expected_ratio, mhd_1, mhd_2[, thresh])

opengate.helpers_tests.test_ok(is_ok=False)[source]
opengate.helpers_tests.delete_run_manager_if_needed(sim)[source]
opengate.helpers_tests.read_stat_file(filename)[source]
opengate.helpers_tests.print_test(b, s)[source]
opengate.helpers_tests.assert_stats(stat1, stat2, tolerance=0, is_ok=True)[source]
opengate.helpers_tests.plot_img_axis(ax, img, label, axis='z')[source]
opengate.helpers_tests.plot_img_z(ax, img, label)[source]
opengate.helpers_tests.plot_img_y(ax, img, label)[source]
opengate.helpers_tests.plot_img_x(ax, img, label)[source]
opengate.helpers_tests.assert_images(ref_filename1, filename2, stats=None, tolerance=0, ignore_value=0, axis='z', fig_name=None, sum_tolerance=5)[source]
opengate.helpers_tests.exponential_func(x, a, b)[source]
opengate.helpers_tests.Gauss(x, A, x0, sigma)[source]
opengate.helpers_tests.fit_exponential_decay(data, start, end)[source]
opengate.helpers_tests.get_new_key_name(key)[source]
opengate.helpers_tests.get_keys_correspondence(keys)[source]
opengate.helpers_tests.rel_diff(a, b)[source]
opengate.helpers_tests.rel_diff_range(a, b)[source]
opengate.helpers_tests.get_branch(tree, keys, key)[source]

Return a branch whether it is a numpy or a uproot tree

opengate.helpers_tests.compare_branches(tree1, keys1, tree2, keys2, key1, key2, tol=0.8, scaling1=1, scaling2=1, ax=False, nb_bins=200)[source]

Compare with Wasserstein distance Works well, but not easy to set the tolerance value.

opengate.helpers_tests.compare_branches_values(b1, b2, key1, key2, tol=0.8, ax=False, nb_bins=200)[source]

Compare with Wasserstein distance Works well, but not easy to set the tolerance value.

opengate.helpers_tests.compare_trees(tree1, allkeys1, tree2, allkeys2, keys1, keys2, tols, scalings1, scalings2, fig=False, nb_bins=200)[source]
opengate.helpers_tests.get_default_test_paths(f, gate_folder=None)[source]
opengate.helpers_tests.compare_root2(root1, root2, branch1, branch2, keys, img_filename, n_tol=3)[source]
opengate.helpers_tests.compare_root(root1, root2, branch1, branch2, checked_keys, img)[source]
opengate.helpers_tests.compare_root3(root1, root2, branch1, branch2, keys1, keys2, tols, scalings1, scalings2, img, hits_tol=6, nb_bins=200)[source]
opengate.helpers_tests.dict_compare(d1, d2)[source]
opengate.helpers_tests.write_gauss_param_to_file(outputdir, planePositionsV, saveFig=False, fNamePrefix='plane', fNameSuffix='a.mhd')[source]
opengate.helpers_tests.get_gauss_param_xy(data, spacing, shape, filepath=None, saveFig=False)[source]
opengate.helpers_tests.extract_gauss_param_1D(data, length, spacing, axis=1, createFig=False)[source]
opengate.helpers_tests.plot_gauss_fit(positionVec, dose, fit, show=False)[source]
opengate.helpers_tests.create_position_vector(length, spacing)[source]
opengate.helpers_tests.Gauss(x, A, x0, sigma)[source]
opengate.helpers_tests.gaussian_fit(positionVec, dose)[source]
opengate.helpers_tests.read_mhd(filename)[source]
opengate.helpers_tests.create_2D_Edep_colorMap(filepath, show=False)[source]
opengate.helpers_tests.compareGaussParamFromFile(sigma, ref, rel_tol=0, abs_tol=0, verb=False)[source]
opengate.helpers_tests.compareGaussParamArrays(paramTestV, paramRefV, rel_tol=0, abs_tol=0, verb=False)[source]
opengate.helpers_tests.test_weights(expected_ratio, mhd_1, mhd_2, thresh=0.1)[source]