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 to compare a dose calculation using a phsp source with the equivalent
4ab-initio simulation.
5
6"""
7
8import math
9import os
10import re
11
12from eb_tests.utils import (compare_3ddose_files, doses_approx_equal,
13 extract_all_doses, read3ddose)
14
15EGSINP = "phsp_run.egsinp"
16TIME_LIMIT_S_PER_MHZ = 80/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__)), "phsp_run_compare.phantom.3ddose")
22 run_doses = inp_name+".phantom.3ddose"
23
24 doses_close = compare_3ddose_files(gold_standard, run_doses, max_percent_diff=0.01)
25
26 gs_doses = read3ddose(gold_standard)
27 actual_doses = read3ddose(run_doses)
28
29 return doses_close, actual_doses, gs_doses