In [18]:
%pylab inline
from scipy.interpolate import interp1d

from IPython.display import Image


Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['f']
`%matplotlib` prevents importing * from pylab and numpy

Details

Below are the recorded measurements for the first batch of cutout factor measurements

Ionisation conversion

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 [19]:
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)

Measurements

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.

Readings


In [20]:
standard_insert_reading = {}
cutout_reading = {}
factor = {}

Standard Insert


In [21]:
standard_insert_reading = array([])

standard_insert_reading = append(standard_insert_reading,mean([1.542,1.542,1.542])) # 01
standard_insert_reading = append(standard_insert_reading,mean([1.540,1.540,1.540])) # 02
standard_insert_reading = append(standard_insert_reading,mean([1.541,1.541,1.541])) # 03
standard_insert_reading = append(standard_insert_reading,mean([1.540,1.540,1.540])) # 04
standard_insert_reading = append(standard_insert_reading,mean([1.538,1.538,1.538])) # 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)

Output function definition


In [22]:
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

Cutout readings


In [23]:
# Applicator 01 measurement done here

In [24]:
cutout = '5'
depth = array([25,24,23,22])
readings = array([])

readings = append(readings,mean([1.491,1.492,1.492])) # ionisation at depth 25 mm RW3
readings = append(readings,mean([1.498,1.498,1.499])) # ionisation at depth 24 mm RW3
readings = append(readings,mean([1.502,1.502,1.502])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.505,1.504,1.505])) # ionisation at depth 22 mm RW3

cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.541)


Reading = 1.502
Cutout factor = 1.030 | 3.0%

In [25]:
# Applicator 02 measurement done here

In [26]:
# After some time 03 measurement done here

In [27]:
cutout = '4'
depth = array([23,22,21,20,19,18])
readings = array([])

readings = append(readings,mean([1.468,1.469,1.469])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.477,1.478,1.477])) # ionisation at depth 22 mm RW3
readings = append(readings,mean([1.483,1.483,1.483])) # ionisation at depth 21 mm RW3
readings = append(readings,mean([1.488,1.488,1.487])) # ionisation at depth 20 mm RW3
readings = append(readings,mean([1.491,1.491,1.491])) # ionisation at depth 19 mm RW3
readings = append(readings,mean([1.493,])) # ionisation at depth 18 mm RW3

cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.540)


Reading = 1.491
Cutout factor = 1.046 | 4.6%

In [28]:
# Applicator 04 measurement done here

In [29]:
cutout = '3'
depth = array([16])
readings = array([])

# readings = append(readings,mean([1.444,1.444,1.444])) # ionisation at depth 18 mm RW3
# readings = append(readings,mean([1.452,1.452])) # ionisation at depth 17 mm RW3
# readings = append(readings,mean([1.457])) # ionisation at depth 16 mm RW3
# readings = append(readings,mean([1.458])) # ionisation at depth 15 mm RW3
readings = append(readings,mean([1.456,1.456,1.455])) # ionisation at depth 16 mm RW3


cutout_reading[cutout], factor[cutout] = outputFunction(depth,readings,1.538)


Reading = 1.456
Cutout factor = 1.076 | 7.6%

In [30]:
# Applicator 05 measurement done here

In [31]:
# Measure of 38's eq ellipse
depth = array([22])
readings = array([])

# readings = append(readings,mean([1.498,1.498])) # ionisation at depth 21 mm RW3
# readings = append(readings,mean([1.496])) # ionisation at depth 22 mm RW3
# readings = append(readings,mean([1.492,1.493])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.495,1.495,1.495])) # ionisation at depth 22 mm RW3

outputFunction(depth,readings,1.539);

Image('../figures/saved/'+'038'+'.png')


Reading = 1.495
Cutout factor = 1.036 | 3.6%
Out[31]:

In [32]:
# Applicator 06 here

In [33]:
# Remeasure of 38
depth = array([23,22])
readings = array([])

readings = append(readings,mean([1.501,1.502])) # ionisation at depth 23 mm RW3
readings = append(readings,mean([1.504,1.504])) # ionisation at depth 22 mm RW3

outputFunction(depth,readings,1.539);
Image('../figures/saved/'+'038'+'.png')


Reading = 1.502
Cutout factor = 1.029 | 2.9%
Out[33]:

In [34]:
with open('circle_cutout_factors','r') as f:
    
    loaded_factors = eval(f.read())

    
factors_to_save = dict(list(loaded_factors.items()) + list(factor.items()))

with open('circle_cutout_factors','w') as f:
    
    f.write(str(factors_to_save))