EGS Brachy
An egs++ user code for rapid brachytherapy calculations
Loading...
Searching...
No Matches
test.py
Go to the documentation of this file.
1"""
2
3 This test ensures the 'single generator=no' and 'single_generator=yes' options give
4 the same results.
5
6 Gold standard dose distribution was generated with egs_brachy and multiple_generator.egsinp
7
8"""
9
10import math
11import os
12import re
13
14from eb_tests.utils import (compare_3ddose_files, doses_approx_equal,
15 extract_all_doses, read3ddose)
16
17EGSINP = "single_generator.egsinp"
18TIME_LIMIT_S_PER_MHZ = 25/2993. # s / MHz
19
20
21def compare_results(egslst, inp_name):
22
23 gold_standard = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gold_standard.3ddose")
24 run_doses = inp_name+".phantom.3ddose"
25
26 doses_close = compare_3ddose_files(gold_standard, run_doses, max_percent_diff=0.01)
27
28 return doses_close, read3ddose(run_doses), read3ddose(gold_standard)