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
3A test for comparing dose calculated by egs_brachy in a simple rectilinear
4phantom containing multiple 6702 sources (some of which are
5rotated/translated). The calculated dose is compared with dose values
6calculated when egs_brachy was in a known good state.
7
8"""
9
10
11
12import math
13import os
14import re
15
16from eb_tests.utils import (compare_3ddose_files, doses_approx_equal,
17 extract_all_doses, read3ddose)
18
19EGSINP = "seeds_in_xyz.egsinp"
20TIME_LIMIT_S_PER_MHZ = 25/2993. # s / MHz
21
22
23def compare_results(egslst, inp_name):
24
25 gold_standard = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gold_standard.3ddose")
26 run_doses = inp_name+".phantom.3ddose"
27
28 doses_close = compare_3ddose_files(gold_standard, run_doses, max_percent_diff=0.01)
29
30 return doses_close, read3ddose(run_doses), read3ddose(gold_standard)