In [84]:
%pylab inline
from scipy.interpolate import interp1d
from IPython.display import Image
Below are the recorded measurements for the first batch of cutout factor measurements
The following cell is used to initialise the ionisation to dose conversion function. Data is extracted from table 20 within TRS398. R50 of the 12 MeV beam is $4.75~g/cm^2$
In [85]:
zOnR50 = concatenate((array([0.02]), arange(0.05,1.25,0.05)))
R50of45 = array([0.997,1,1.004,1.008,1.012,1.017,1.021,1.026,1.03,
1.035,1.04,1.045,1.051,1.056,1.062,1.067,1.073,1.08,
1.086,1.092,1.099,1.106,1.113,1.120,1.128])
R50of50 = array([0.991,0.994,0.998,1.002,1.006,1.011,1.016,1.02,1.025,
1.03,1.035,1.041,1.046,1.052,1.058,1.064,1.07,1.076,
1.083,1.09,1.097,1.104,1.112,1.119,1.128])
R50of47_5 = mean([R50of45,R50of50],axis=0)
stopRatio = interp1d(zOnR50 * 47.5,R50of47_5)
These measurements were done on Harry 2694, with a Markus chamber set to +300 V. The sensitivity was $1.398 \times 10^9$. All measurements were done at 100 SSD with a 12 MeV beam and a $10\times10$ cm applicator. Below are the readings recorded in chronological order.
In [86]:
standard_insert_reading = {}
cutout_reading = {}
factor = {}
In [87]:
standard_insert_reading = array([])
standard_insert_reading = append(standard_insert_reading,mean([1.546,1.546])) # 01
standard_insert_reading = append(standard_insert_reading,mean([1.544,1.544])) # 02
standard_insert_reading = append(standard_insert_reading,mean([1.543,1.543])) # 03
standard_insert_reading = append(standard_insert_reading,mean([1.542,1.542])) # 04
standard_insert_reading = append(standard_insert_reading,mean([1.544,1.544])) # 05
# standard_insert_reading = append(standard_insert_reading,mean([1.539,1.539,1.539])) # 06
uncertainty = std(standard_insert_reading)
standard_insert_reading = mean(standard_insert_reading)
In [88]:
def outputFunction(depth,readings,reference):
if size(readings) == 1:
cutout_reading = readings
factor = reference / cutout_reading * (stopRatio(25) / stopRatio(depth[0]))
else:
stop_ratio_corrected = stopRatio(depth) * readings
scatter(depth,stop_ratio_corrected)
ylabel('Stopping power ratio corrected')
xlabel('Depth (mm)')
title('Relative ionsation to relative dose')
show()
ref = argmax(stop_ratio_corrected)
cutout_reading = readings[ref]
factor = (reference / cutout_reading) * (stopRatio(25) / stopRatio(depth[ref]))
print("Reading = %0.3f" %(cutout_reading))
print("Cutout factor = %0.3f | %0.1f%%" %(factor, (factor - 1) * 100))
return cutout_reading, factor
In [89]:
# Applicator 01 measurement done here
In [90]:
cutout = '5x13'
depth = array([25,24])
readings = array([])
readings = append(readings,mean([1.524,1.525,1.524])) # ionisation at depth 25 mm RW3
readings = append(readings,mean([1.529,1.529,1.529])) # ionisation at depth 24 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.546)
In [91]:
cutout = '5x10'
depth = array([24,23])
readings = array([])
readings = append(readings,mean([1.530,1.530,1.529])) # ionisation at depth 24 mm RW3
readings = append(readings,mean([1.529])) # ionisation at depth 23 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.545)
In [92]:
cutout = '5x8'
depth = array([23,24])
readings = array([])
readings = append(readings,mean([1.525,1.525])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.522,1.522,1.523])) # ionisation at depth 24 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.545)
In [93]:
cutout = '4x13'
depth = array([24,23,22])
readings = array([])
readings = append(readings,mean([1.508,1.509,1.508])) # ionisation at depth 24 mm RW3
readings = append(readings,mean([1.513,1.513,1.513])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.516,])) # ionisation at depth 22 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.544)
In [94]:
# App 02 here
In [95]:
cutout = '4x10'
depth = array([23,22])
readings = array([])
readings = append(readings,mean([1.505,1.506,1.505])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.509,1.508,1.509])) # ionisation at depth 22 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.544)
In [96]:
cutout = '4x8'
depth = array([22,21])
readings = array([])
readings = append(readings,mean([1.508,1.508,1.508])) # ionisation at depth 22 mm RW3
readings = append(readings,mean([1.510])) # ionisation at depth 21 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.5435)
In [97]:
cutout = '4x6.5'
depth = array([21,22])
readings = array([])
readings = append(readings,mean([1.495,1.496,1.496])) # ionisation at depth 21 mm RW3
readings = append(readings,mean([1.492,1.492,1.491])) # ionisation at depth 22 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.5435)
In [98]:
cutout = '3x13'
depth = array([21,19,20])
readings = array([])
readings = append(readings,mean([1.481,1.481])) # ionisation at depth 21 mm RW3
# readings = append(readings,mean([1.488,])) # ionisation at depth 20 mm RW3
readings = append(readings,mean([1.490,1.488])) # ionisation at depth 19 mm RW3
readings = append(readings,mean([1.485,1.485])) # ionisation at depth 20 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.543)
In [99]:
# App 03
In [100]:
cutout = '3x9'
depth = array([19,18])
readings = array([])
readings = append(readings,mean([1.483,1.483])) # ionisation at depth 19 mm RW3
readings = append(readings,mean([1.483,1.485,1.484])) # ionisation at depth 18 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.543)
In [101]:
cutout = '3x6.5'
depth = array([18,19])
readings = array([])
readings = append(readings,mean([1.484,1.483])) # ionisation at depth 18 mm RW3
readings = append(readings,mean([1.480,1.480])) # ionisation at depth 19 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.542)
In [102]:
# App 04 here
In [103]:
cutout = '3x5'
depth = array([18,17])
readings = array([])
readings = append(readings,mean([1.462,1.462])) # ionisation at depth 18 mm RW3
readings = append(readings,mean([1.465,1.465])) # ionisation at depth 17 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.542)
In [104]:
cutout = 'EqBanana'
depth = array([17,16])
readings = array([])
readings = append(readings,mean([1.460,1.460])) # ionisation at depth 17 mm RW3
readings = append(readings,mean([1.463,1.463])) # ionisation at depth 16 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.543)
In [105]:
cutout = 'Banana'
depth = array([16,15])
readings = array([])
readings = append(readings,mean([1.473,1.473])) # ionisation at depth 16 mm RW3
readings = append(readings,mean([1.475,1.474])) # ionisation at depth 15 mm RW3
cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.544)
In [106]:
# App 05
In [107]:
with open('custom_cutout_factors','r') as f:
loaded_factors = eval(f.read())
factors_to_save = dict(list(loaded_factors.items()) + list(factor.items()))
# factors_to_save = factor
with open('custom_cutout_factors','w') as f:
f.write(str(factors_to_save))