In [9]:
%pylab inline
from scipy.interpolate import interp1d
In [2]:
R50 = 47.5
zOnR50 = concatenate((array([0.02]), arange(0.05,1.25,0.05)))
zOnR50
Out[2]:
In [3]:
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)
R50of47_5
Out[3]:
In [10]:
interp_funtion = interp1d(zOnR50 * 47.5,R50of47_5)
In [18]:
plot(zOnR50 * 47.5,R50of47_5,'rx')
ylabel('Stopping power ratio')
xlabel('Depth (mm)')
title('Stopping power ratios')
x0 = linspace(min(zOnR50 * 47.5),max(zOnR50 * 47.5))
plot(x0,interp_funtion(x0),'b')
Out[18]:
In [21]:
depth = array([25,24,23,22])
ionisation = array([])
ionisation[0] = mean([1.516,1.517,1.516])
ionisation[1] = mean([1.519,1.519])
ionisation[2] = mean([1.522])
ionisation[3] = mean([1.520])