-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
127 lines (90 loc) · 3.5 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
print("This program is to perform shielding calculations for Linac room \n")
print("First part: Workload calculations \n")
pa=float(input("Patients per day:"))
gy=float(input("Gray per patient (Gy):"))
we=float(input("Day per week:"))
w1=float(input("Fraction of workload (leackage):"))
wt=float(input("Total weeks:"))
qc=float(input("Quality control percentage:"))
ww= pa*gy*we*w1*wt # workload sin el porcentaje de QC
qc1= (qc/100)*ww #Adicion de porcentaje
w= ww+qc1 #workload total este es el usado para los calculos
print("The worload is:\n",w)
print("Second part: Shieldind Calculations \n")
energy= input ("Choose the energy 6MV, 10MV, 15MV, 18MV:")
if energy=="6":
print("1 --> Primary shielding")
print("2 --> Secondary shielding ")
print("3 --> Scatter from Patient Shielding Calculations")
print("4 --> Scatter of the Primary Beam from the Bunker Wall ")
print("5 --> Scatter from the Patient")
print("6 --> Scatter of Head Leakage Radiation from the Bunker Walls")
print("7 --> Transmission of Head Leakage Radiation through the Maze Wall")
print("8 --> Total dose rate at the maze entrance and door shielding")
types=input("Choose the type of shielding:\n")
if types=="1":
#Primary shielding
#print("Types of areas avilables: \n ")
#print("1 --> Fully area")
#print("2 --> Abjecent treament room")
#print("3 --> Corridor")
#print("4 --> Linac bunker")
#print("5 --> Toilet, storage areas")
#print("6 --> Outdoor areas")
#T= input("Choose the type of area:\n")
p1=float(input("Value of shielding design dose 'P' (Sv/y):"))
T= float(input ("Value of ocupancy factor 'T': "))
U= float(input ("Value of use factor 'U':"))
d= float( input ("Value of distance primary beam 'd' (m):"))
TVL1= float( input ("Value of primary barrier for TVL1:"))
TVLe= float(input ("Value of primary barrier for TVLe:"))
D= d**2
B=(p1*D)/(w*T*U)
n=-np.log10(B)
thickness=TVL1+((n-1)*TVLe)
print("The barrier of primary shielding thickness is (cm)",thickness)
elif types=="2":
#Secondary shieldong
fww=float(input("Workload factor for VMT:"))
p1=float(input("Value of shielding design dose 'P' (Sv/y):"))
T= float(input ("Value of ocupancy factor 'T': "))
#U= float(input ("Value of use factor 'U':"))
L= float(input("L leakage factor: "))
d= float( input ("Value of distance primary beam 'd' (m):"))
TVL1= float( input ("Value of secondary barrier for TVL1:"))
TVLe= float(input ("Value of secondary barrier for TVLe:"))
fw= (fww/100)*ww #Workload factor for VMT or IMRT
w= ww+fw
#new workload for secondary barrier
D= d**2
B=(p1*D)/(w*T*L)
n=-np.log10(B)
thickness=TVL1+((n-1)*TVLe)
print("The barrier of secondsary shielding thickness is (cm)",thickness)
elif types=="3":
#Scatter from Patient Shielding Calculations
print("papa")
elif types=="4":
#Scatter of the Primary Beam from the Bunker Wall
print("papa")
elif types=="5":
#Scatter from the Patient
print("papa")
elif types=="6":
#Scatter of Head Leakage Radiation from the Bunker Walls
print("papa")
elif types=="7":
#Transmission of Head Leakage Radiation through the Maze Wall
print("papa")
elif types=="8":
# Total dose rate at the maze entrance and door shielding
print("papa")
elif energy=="10":
print("papa")
elif energy=="15":
print("papa")
elif energy=="18":
print("papa")