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 and
4recyling on with calculations from when egs_brachy was in a known good state.
5
6Gold standard dose distribution was generated with egs_brachy and
7gold_standard.egsinp
8
9"""
10
11import math
12import os
13import re
14
15from eb_tests.utils import (compare_3ddose_files, doses_approx_equal,
16 extract_all_doses, read3ddose)
17
18EGSINP = "variable_w_recycling.egsinp"
19TIME_LIMIT_S_PER_MHZ = 15/2993. # s / MHz
20
21# benchmark doses calcualted using egs_brachy and gold_standard.egsinp
22BENCHMARK_DOSES = [(1.061E-13, 0.0001), (1.644E-13, 0.0001)]
23
24
25def compare_results(egslst, inp_name):
26
27 gold_standard = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gold_standard.3ddose")
28 run_doses = inp_name+".phantom.3ddose"
29
30 doses_close = compare_3ddose_files(
31 gold_standard, run_doses, max_percent_diff=0.0015)
32
33 return doses_close, read3ddose(run_doses), read3ddose(gold_standard)