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 the dose from sources with different source weighting with
4calculations from when egs_brachy was in a known good state.
5
6"""
7
8import math
9import os
10import re
11
12from eb_tests.utils import (doses_approx_equal, extract_all_doses, read3ddose,
13 values_close)
14
15EGSINP = "variable.egsinp"
16TIME_LIMIT_S_PER_MHZ = 100/2993. # s / MHz
17
18
19def compare_results(egslst, inp_name):
20
21 gold_standard = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gold_standard.3ddose")
22 run_doses_file = inp_name+".phantom.3ddose"
23
24 # central axis doses
25 gold_doses = read3ddose(gold_standard)['doses'][:5]
26 run_doses = read3ddose(run_doses_file)['doses'][:5]
27
28 close = [values_close(g, r, 0.005) for g, r in zip(gold_doses, run_doses)]
29
30
31 return all(close), run_doses, gold_doses