#%matplotlib widget
import numpy as np
from bokeh.layouts import widgetbox, column, row
from bokeh.models import Slider
import bokeh.plotting as plt
from bokeh.models import HoverTool, ColumnDataSource, Select, Slider, WheelZoomTool, Range1d, markers, Arrow, NormalHead
from bokeh.io import output_notebook, show, push_notebook, output_file, curdoc
#output_file("test.html")
from scipy.spatial.transform import Rotation
from scipy.linalg import det
output_notebook()
### functions for rectangle intersections
def rotate_detector_2d(l=80, b=40, e_det=10, beta=0):
"""rotates the detector around the center of the flange by beta, where the long detector axis is along x for beta = 0"""
e1 = np.array([b/2, l/2+e_det, 0])
e2 = np.array([-b/2, l/2+e_det, 0])
e3 = np.array([-b/2, -l/2+e_det, 0])
e4 = np.array([b/2, -l/2+e_det, 0])
r_beta = Rotation.from_euler('z', [beta], degrees=False)
e1,e2,e3,e4 = r_beta.apply([e1,e2,e3,e4])
return np.array([e1[:2],e2[:2],e3[:2],e4[:2]])
def radii_rectangle(l=80, b=40, e_det=10, e_sample=np.array([0,46]), gam=np.array([0]), beta=0):
"""calculates the distance between sample and the intersection points of the detector projected onto the x-z pllane for given beta and gamma angles"""
gam = -gam
s = e_sample
s1 = np.zeros((len(gam),2,2)) + s
s1[:,0,0] = s1[:,0,0] -250*np.array(np.cos(gam))
s1[:,0,1] = s1[:,0,1] +250*np.array(np.sin(gam))
s1[:,1,0] = s1[:,1,0] +250*np.array(np.cos(gam))
s1[:,1,1] = s1[:,1,1] -250*np.array(np.sin(gam))
e1,e2,e3,e4 = rotate_detector_2d(l=l, b=b, e_det=e_det, beta=beta)
es = np.array([[e1,e2], [e1,e4], [e2,e3], [e3,e4]])
M = np.array( [np.array([np.divide( det([p1-p3,p3-p4]),det([p1-p2,p3-p4])) for p3, p4 in zip(s1[:,0],s1[:,1]) ]) for p1,p2 in es])
M[~((M<1.)&(M>0.))] = np.nan
p1s = es[:,0]
p2s = es[:,1]
intersects = np.array([m[:,None]*(p2s-p1s)+p1s for m in M.T])
radii_2d = np.linalg.norm(intersects-s, axis=2)*(intersects-s)[:,:,1]/-abs((intersects-s)[:,:,1])
radii_2d = np.array([np.nanmax(radii_2d, axis=1), np.nanmin(radii_2d, axis=1)])
return radii_2d
### functions for circle intersections
def radii(gamma, x0, y0, r):
'''calculates the two intersections of a line from the origin with the circle defining the window'''
r1 = np.cos(gamma)*x0+np.sin(gamma)*y0 + np.sqrt((np.cos(gamma)*x0+np.sin(gamma)*y0)**2 -(x0**2+y0**2-r**2))
r2 = np.cos(gamma)*x0+np.sin(gamma)*y0 - np.sqrt((np.cos(gamma)*x0+np.sin(gamma)*y0)**2 -(x0**2+y0**2-r**2))
return (r1,r2)
def excentricity(beta, e_window, e_sample=[0,-46]):
'''calculates the excentricity of the circle defining the window for different top flange rotations'''
x0 = np.cos(beta)*e_window - e_sample[0]
y0 = np.sin(beta)*e_window - e_sample[1]
return x0, y0
def phi(r, h):
'''
Returns the scatter angle measured from the vertical of r with height above the sample,h.
'''
return np.arctan(r/h)
def delta_from_beta(beta, gamma, r, e_window, e_sample, h):
x0,y0 = excentricity(beta, e_window, e_sample)
radiis = radii(gamma, x0, y0,r)
deltas = [90-np.rad2deg(phi(radiius, h)) for radiius in radiis]
return deltas
def circle(beta, e_window, e_sample, r):
'''calculates the excentricity of the circle defining the window for different top flange rotations'''
x0,y0 = excentricity(beta, e_window, e_sample)
phi = np.linspace(0, 2*np.pi, 3601, endpoint=True)
x = r * np.cos(phi) - x0
y = r * np.sin(phi) - y0
return x, y
'''In-vacuum detector - scattering angles 1 position'''
gamma_invac = np.linspace(0.001, np.pi+0.001, 121, endpoint=True)
h_invac = 42
l_invac = 80
b_invac = 40
e_invac = 36
e_sample_invac = np.array([0,46])
beta=np.deg2rad(0)
radii_2d = radii_rectangle(l=l_invac, b=b_invac, e_det=e_invac, e_sample=e_sample_invac, gam=gamma_invac, beta=beta )
deltamin, deltamax = [90-np.rad2deg(phi(radii_2d[0], h_invac)),90-np.rad2deg(phi(radii_2d[1], h_invac))]
source_invac = ColumnDataSource(data=dict(x=np.rad2deg(gamma_invac), y1=deltamin, y2 = deltamax))
rect_edges_invac = rotate_detector_2d(l=l_invac, b=b_invac, e_det=e_invac, beta=beta) - e_sample_invac
rect_edges_invac = np.vstack([rect_edges_invac,rect_edges_invac[0]])
source_invac_rect = ColumnDataSource(data=dict(x=rect_edges_invac.T[0], y=rect_edges_invac.T[1]))
'''In-vacuum detector - scattering angles cumulative all position'''
betas = np.linspace(0,2*np.pi, 60)
gammas = np.linspace(0.001,np.pi+0.001, 60)
radii_2d = np.array([radii_rectangle(l=l_invac, b=b_invac, e_det=e_invac, e_sample=e_sample_invac, gam=gammas, beta=beta ) for beta in betas])
rs = np.array([np.nanmax(radii_2d, axis=(0,1)), np.nanmin(radii_2d, axis=(0,1))])
deltamin, deltamax = [90-np.rad2deg(phi(rs[0], h_invac)),90-np.rad2deg(phi(rs[1], h_invac))]
source_invac_full_betas = ColumnDataSource(data=dict(x=np.rad2deg(gammas), y1=deltamin, y2 = deltamax))
'''Beryllium window - scattering angles 1 position'''
gamma = np.linspace(0, np.pi, 361, endpoint=True)
h = 36
r = 70/2
e_window = 30
e_sample = [0,-46]
beta=0
deltamin, deltamax = delta_from_beta(np.deg2rad(beta-90), gamma, r, e_window, e_sample, h)
source_window = ColumnDataSource(data=dict(x=np.rad2deg(gamma), y1=deltamin, y2 = deltamax))
#source = ColumnDataSource(data=dict(x=np.rad2deg(gamma), y=deltamin))
x,y = circle(np.deg2rad(beta-90), e_window, e_sample, r)
source_window_circle = ColumnDataSource(data=dict(x=x, y=y))
'''Be window - scattering angles cumulative all position'''
betas = np.linspace(0,2*np.pi, 360)
delta_from_beta(np.deg2rad(0), gamma, r, e_window, e_sample, h)
ds = np.array([delta_from_beta(beta, gamma, r, e_window, e_sample, h) for beta in betas])
dmins = np.array([np.nanmin(dmin) for dmin in ds[:,0,:].T])
dmaxs = np.array([np.nanmax(dmax) for dmax in ds[:,1,:].T])
source_window_full_betas = ColumnDataSource(data=dict(x=np.rad2deg(gamma), y1=dmins, y2 = dmaxs))
'''Top flange - scattering angles'''
h_t = 102
r_t = 248.5/2
e_window_t = 0
deltamin_t, deltamax_t = delta_from_beta(0, gamma, r_t, e_window_t, e_sample, h_t)
source_top_flange = ColumnDataSource(data=dict(x=np.rad2deg(gamma), y1=deltamin_t, y2 = deltamax_t))
x,y = circle(0, e_window_t, e_sample, r_t)
source_top_flange_circle = ColumnDataSource(data=dict(x=x, y=y))
g = plt.figure(title='Geometry')
imgurl = 'https://drive.switch.ch/index.php/apps/files_sharing/ajax/publicpreview.php?x=3360&y=1040&a=true&file=Be_window9.JPG&t=WgAa3cg9sgVJFZK&scalingup=0'
g.image_url(url=[imgurl], x=-166, y=-203, w=330, h=350, anchor="bottom_left")
g.line('x', 'y', source=source_invac_rect, line_width=5, line_color = 'green', legend_label="In-vacuum det")
g.line('x', 'y', source=source_window_circle, line_width=5, line_color = 'royalblue', legend_label="Be window")
g.line('x', 'y', source=source_top_flange_circle, line_width=5, line_color = 'grey')
g.circle(x=0, y=0, size=10,fill_color="orange", line_color = 'black', legend_label="Sample")
g.y_range=Range1d(-205, 145)
g.x_range=Range1d(-165, 165)
g.title.align='center'
def update_plot(attr, old, new):
beta = new-90
deltamin, deltamax = delta_from_beta(np.deg2rad(beta), gamma, r, e_window, e_sample, h)
source_window.data = dict(x=np.rad2deg(gamma), y1=deltamin, y2 = deltamax)
radii_2d = radii_rectangle(l=l_invac, b=b_invac, e_det=e_invac, e_sample=e_sample_invac, gam=gamma_invac, beta=np.deg2rad(new) )
deltamin, deltamax = [90-np.rad2deg(phi(radii_2d[0], h_invac)),90-np.rad2deg(phi(radii_2d[1], h_invac))]
source_invac.data = dict(x=np.rad2deg(gamma_invac), y1=deltamin, y2 = deltamax)
rect_edges_invac = rotate_detector_2d(l=l_invac, b=b_invac, e_det=e_invac, beta=np.deg2rad(new)) - e_sample_invac
rect_edges_invac = np.vstack([rect_edges_invac,rect_edges_invac[0]])
source_invac_rect.data = dict(x=rect_edges_invac.T[0], y=rect_edges_invac.T[1])
x,y = circle(np.deg2rad(beta), e_window, e_sample, r)
source_window_circle.data = dict(x=x, y=y)
#p.line('x', 'y', source=source, line_width=3, line_alpha=0.6)
#push_notebook()
p = plt.figure(title='Diffraction Angles')
p.line('x', 'y1', source=source_invac, line_width=5, line_alpha=1., line_color='green', legend_label="In-vacuum detector")
p.line('x', 'y2', source=source_invac, line_width=5, line_alpha=1., line_color='green')
p.line('x', 'y1', source=source_invac_full_betas, line_width=5, line_alpha=.6, line_color='green', line_dash='dashed')
p.line('x', 'y2', source=source_invac_full_betas, line_width=5, line_alpha=.6, line_color='green', line_dash='dashed')
p.line('x', 'y1', source=source_window, line_width=5, line_color = 'royalblue', line_alpha=1., legend_label="Be window")
p.line('x', 'y2', source=source_window, line_width=5, line_color = 'royalblue', line_alpha=1.)
p.line('x', 'y1', source=source_window_full_betas, line_width=5, line_color = 'royalblue', line_alpha=.6, line_dash='dashed')
p.line('x', 'y2', source=source_window_full_betas, line_width=5, line_color = 'royalblue', line_alpha=.6, line_dash='dashed')
p.line('x', 'y1', source=source_top_flange, line_width=5, line_alpha=.6, line_color='grey', legend_label="CF250 flange")
p.line('x', 'y2', source=source_top_flange, line_width=5, line_alpha=.6, line_color='grey')
p.add_tools(HoverTool(tooltips=[("(gamma,delta)", "($x, $y)")]))
p.toolbar.active_scroll = p.select_one(WheelZoomTool)
p.xaxis.axis_label = 'gamma (deg)'
p.yaxis.axis_label = 'delta (deg)'
p.xaxis.ticker = [0, 45,90,135,180]
p.yaxis.ticker = [0, 45,90,135,180]
p.legend.location='top_left'
p.title.align='center'
slider = Slider(start=0., end=360., step=15., value = 0., title='Position of Be window (90° downstream along beam)')
slider.on_change('value',update_plot)
p.x_range=Range1d(0, 180)
p.y_range=Range1d(0, 180)
g.xaxis.axis_label = 'z (mm)'
g.yaxis.axis_label = 'x (mm)'
g.xaxis.ticker = [-200,-100, 0,100,200]
g.yaxis.ticker = [-100, 0,100,200]
g.legend.location='top_left'
figs = [p,g]
for fig in figs:
#fig.title.text_font_size = '1pt'
fig.legend.label_text_font_size = '16pt'
fig.legend.background_fill_alpha = 0
fig.legend.border_line_alpha = 0
for axis in fig.axis:
axis.axis_label_text_font_size = '16pt'
axis.major_label_text_font_size = '16pt'
axis.axis_label_text_font_style = 'normal'
#curdoc().add_root(layout)
imgs = row(p,g)
layout = column(imgs)
plt.show(layout, notebook_handle=True)
#curdoc().title = "THC illustrator
#np.save([])
C:\Users\Brick\miniconda3\lib\site-packages\ipykernel_launcher.py:46: RuntimeWarning: All-NaN slice encountered C:\Users\Brick\miniconda3\lib\site-packages\ipykernel_launcher.py:55: RuntimeWarning: invalid value encountered in sqrt C:\Users\Brick\miniconda3\lib\site-packages\ipykernel_launcher.py:56: RuntimeWarning: invalid value encountered in sqrt
<Bokeh Notebook handle for In[5]>
import pylab as plt2
fig, ax = plt2.subplots(2,1, sharex=True, figsize=(5*0.35/0.45,4.2))
ax[0].plot(source_invac.data['x'], source_invac.data['y1'], color='seagreen', label='$in$-$vacuum$ $detector$')
ax[0].plot(source_invac.data['x'], source_invac.data['y2'], color='seagreen')
ax[0].plot(source_invac_full_betas.data['x'], source_invac_full_betas.data['y1'], color='seagreen', linestyle=(5,(4,4)))
ax[0].plot(source_invac_full_betas.data['x'], source_invac_full_betas.data['y2'], color='seagreen', linestyle=(5,(4,4)))
ax[0].fill_between(source_invac.data['x'],source_invac.data['y2'], source_invac.data['y1'], color='seagreen', alpha=0.2)
ax[1].plot(source_top_flange.data['x'], source_top_flange.data['y1'], color='grey', label='$CF250$ $flange$', alpha=0.8)
ax[1].plot(source_top_flange.data['x'], source_top_flange.data['y2'], color='grey', alpha=0.8)
ax[1].plot(source_window.data['x'], source_window.data['y1'], color='royalblue', label='$Be$ $window$')
ax[1].plot(source_window.data['x'], source_window.data['y2'], color='royalblue')
ax[1].plot(source_window_full_betas.data['x'], source_window_full_betas.data['y1'], color='royalblue', linestyle=(5,(4,4)))
ax[1].plot(source_window_full_betas.data['x'], source_window_full_betas.data['y2'], color='royalblue', linestyle=(5,(4,4)))
ax[1].fill_between(source_window.data['x'],source_window.data['y2'], source_window.data['y1'], color='royalblue', alpha=0.2)
ax[0].set_ylabel(r'$Elevation$ $\delta$ $(°)$')
ax[1].set_ylabel(r'$Elevation$ $\delta$ $(°)$')
ax[1].set_xlabel(r'$Azimuth$ $\gamma$ $(°)$')
ax[0].set_xlim(0,180)
ax[0].set_ylim(0,180)
ax[1].set_xlim(0,180)
ax[1].set_ylim(0,180)
ax[0].legend(frameon=False, loc='upper center')
ax[1].legend(frameon=False, loc='upper center', ncol=2)
ax[0].tick_params(direction='in')
ax[0].tick_params(direction='in')
ax[1].tick_params(direction='in')
ax[1].tick_params(direction='in')
ax[0].set_xticks([0,30,60,90,120,150,180])
ax[0].set_yticks([0,45,90,135,180])
ax[1].set_yticks([0,45,90,135,180])
fig.tight_layout()
#fig.savefig('accessible_angles.pdf')
Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …
def calc_resolution(h,r,px,energy=2000):
delta1 =np.pi/2- np.arctan(r/h)
#px = px * np.cos(np.pi/2-delta1)
#print('px', px)
delta2 = np.pi/2-np.arctan((r-px)/h)
d_delta = abs(delta1-delta2)
#print('deltas', delta1, delta2, d_delta)
wavelength = 1.24e-6/energy*1e9
#print(energy, wavelength)
d_q = 4*np.pi*np.sin((delta1)/2)/wavelength - 4*np.pi*np.sin((delta2)/2)/wavelength
return [d_delta, d_q]
#fixed
h = 45
px = 75e-3
res, res_q = np.array([calc_resolution(h=h,r=0,px=px, energy=2000), calc_resolution(h=h,r=np.max(rs),px=px, energy=2000)]).T
res, res_q5 = np.array([calc_resolution(h=h,r=0,px=px, energy=5000), calc_resolution(h=h,r=np.max(rs),px=px, energy=5000)]).T
print(f'Angular resolution fixed invac is ({res[1]*1e3:.3} - {res[0]*1e3:.3})mrad')
print(f'q resolution fixed invac @2keV is ({res_q[1]:.3} - {res_q[0]:.3})nm-1')
print(f'q resolution fixed invac @5keV is ({res_q5[1]:.3} - {res_q5[0]:.3})nm-1')
#motorized
h = 245
px = 75e-3
res, res_q = np.array([calc_resolution(h=h,r=0,px=px, energy=2000), calc_resolution(h=h,r=40,px=px, energy=2000)]).T
res, res_q5 = np.array([calc_resolution(h=h,r=0,px=px, energy=5000), calc_resolution(h=h,r=40,px=px, energy=5000)]).T
print(f'Angular resolution mot invac is ({res[1]*1e3:.3} - {res[0]*1e3:.3})mrad')
print(f'q resolution mot invac @2keV is ({res_q[1]:.3} - {res_q[0]:.3})nm-1')
print(f'q resolution mot invac @5keV is ({res_q5[1]:.3} - {res_q5[0]:.3})nm-1')
Angular resolution fixed invac is (0.194 - 1.67)mrad q resolution fixed invac @2keV is (-0.00193 - -0.0119)nm-1 q resolution fixed invac @5keV is (-0.00483 - -0.0298)nm-1 Angular resolution mot invac is (0.298 - 0.306)mrad q resolution mot invac @2keV is (-0.0023 - -0.00219)nm-1 q resolution mot invac @5keV is (-0.00576 - -0.00548)nm-1
x = np.linspace(0,np.max(rs), 500)
y,n = calc_resolution(h=45,r=x,px=px)
[1.57079633 1.56526692 1.55973786 1.55420947 1.54868209 1.54315607 1.53763173 1.53210942 1.52658947 1.52107221 1.51555798 1.51004711 1.50453993 1.49903678 1.49353797 1.48804384 1.48255472 1.47707092 1.47159277 1.46612058 1.46065469 1.45519539 1.449743 1.44429784 1.4388602 1.43343041 1.42800875 1.42259553 1.41719105 1.41179559 1.40640946 1.40103293 1.3956663 1.39030984 1.38496382 1.37962854 1.37430424 1.36899121 1.36368971 1.35839999 1.35312231 1.34785692 1.34260408 1.33736401 1.33213698 1.3269232 1.32172292 1.31653635 1.31136374 1.30620528 1.30106121 1.29593172 1.29081703 1.28571734 1.28063285 1.27556375 1.27051023 1.26547248 1.26045067 1.25544499 1.2504556 1.24548268 1.24052639 1.23558688 1.2306643 1.22575883 1.22087058 1.21599972 1.21114637 1.20631067 1.20149275 1.19669273 1.19191074 1.18714688 1.18240127 1.17767402 1.17296524 1.16827501 1.16360345 1.15895063 1.15431665 1.14970159 1.14510553 1.14052855 1.13597071 1.1314321 1.12691276 1.12241276 1.11793216 1.11347102 1.10902938 1.10460728 1.10020478 1.09582191 1.09145871 1.08711521 1.08279144 1.07848743 1.07420319 1.06993876 1.06569414 1.06146936 1.05726441 1.05307932 1.04891409 1.04476871 1.04064319 1.03653753 1.03245171 1.02838574 1.0243396 1.02031328 1.01630676 1.01232002 1.00835304 1.00440581 1.00047829 0.99657047 0.9926823 0.98881376 0.98496481 0.98113543 0.97732557 0.97353519 0.96976425 0.96601271 0.96228053 0.95856765 0.95487404 0.95119964 0.9475444 0.94390827 0.94029119 0.9366931 0.93311396 0.92955371 0.92601227 0.9224896 0.91898563 0.9155003 0.91203355 0.9085853 0.90515549 0.90174405 0.89835092 0.89497603 0.8916193 0.88828067 0.88496006 0.8816574 0.87837262 0.87510564 0.87185638 0.86862477 0.86541074 0.86221421 0.85903509 0.85587332 0.85272881 0.84960148 0.84649125 0.84339805 0.84032178 0.83726238 0.83421976 0.83119384 0.82818453 0.82519176 0.82221544 0.81925548 0.81631181 0.81338434 0.81047299 0.80757767 0.8046983 0.80183479 0.79898707 0.79615504 0.79333863 0.79053775 0.78775231 0.78498223 0.78222742 0.7794878 0.77676329 0.7740538 0.77135925 0.76867955 0.76601462 0.76336437 0.76072872 0.75810759 0.75550089 0.75290853 0.75033045 0.74776654 0.74521673 0.74268094 0.74015908 0.73765106 0.73515682 0.73267626 0.7302093 0.72775586 0.72531586 0.72288922 0.72047586 0.71807569 0.71568864 0.71331462 0.71095356 0.70860537 0.70626998 0.70394731 0.70163728 0.6993398 0.69705481 0.69478222 0.69252196 0.69027395 0.68803811 0.68581437 0.68360265 0.68140288 0.67921497 0.67703886 0.67487446 0.67272171 0.67058054 0.66845086 0.6663326 0.6642257 0.66213008 0.66004566 0.65797238 0.65591017 0.65385894 0.65181864 0.64978919 0.64777053 0.64576258 0.64376527 0.64177854 0.63980232 0.63783653 0.63588112 0.63393601 0.63200115 0.63007645 0.62816186 0.62625731 0.62436274 0.62247808 0.62060327 0.61873824 0.61688293 0.61503727 0.61320121 0.61137468 0.60955762 0.60774997 0.60595166 0.60416265 0.60238285 0.60061223 0.5988507 0.59709823 0.59535474 0.59362019 0.5918945 0.59017763 0.58846951 0.5867701 0.58507933 0.58339714 0.58172349 0.58005831 0.57840155 0.57675316 0.57511307 0.57348125 0.57185763 0.57024216 0.56863479 0.56703547 0.56544414 0.56386075 0.56228525 0.56071759 0.55915771 0.55760558 0.55606113 0.55452432 0.5529951 0.55147342 0.54995924 0.54845249 0.54695314 0.54546114 0.54397644 0.54249899 0.54102875 0.53956567 0.5381097 0.5366608 0.53521893 0.53378403 0.53235607 0.53093499 0.52952077 0.52811334 0.52671267 0.52531872 0.52393144 0.52255079 0.52117673 0.51980921 0.5184482 0.51709365 0.51574552 0.51440377 0.51306837 0.51173926 0.51041642 0.5090998 0.50778935 0.50648506 0.50518686 0.50389474 0.50260864 0.50132853 0.50005437 0.49878613 0.49752377 0.49626724 0.49501653 0.49377158 0.49253236 0.49129884 0.49007098 0.48884875 0.48763211 0.48642103 0.48521547 0.48401539 0.48282077 0.48163157 0.48044776 0.4792693 0.47809616 0.47692831 0.47576571 0.47460834 0.47345616 0.47230914 0.47116724 0.47003044 0.46889871 0.46777201 0.46665031 0.46553359 0.46442181 0.46331494 0.46221296 0.46111583 0.46002352 0.45893601 0.45785326 0.45677525 0.45570195 0.45463334 0.45356937 0.45251003 0.45145528 0.4504051 0.44935947 0.44831835 0.44728171 0.44624954 0.44522181 0.44419848 0.44317953 0.44216494 0.44115468 0.44014872 0.43914704 0.43814962 0.43715642 0.43616743 0.43518262 0.43420196 0.43322544 0.43225301 0.43128468 0.4303204 0.42936015 0.42840391 0.42745167 0.42650338 0.42555904 0.42461862 0.42368209 0.42274944 0.42182064 0.42089566 0.4199745 0.41905712 0.4181435 0.41723362 0.41632746 0.41542501 0.41452623 0.4136311 0.41273961 0.41185174 0.41096746 0.41008676 0.40920961 0.40833599 0.40746589 0.40659928 0.40573615 0.40487647 0.40402023 0.4031674 0.40231797 0.40147192 0.40062922 0.39978987 0.39895383 0.3981211 0.39729166 0.39646548 0.39564255 0.39482285 0.39400636 0.39319306 0.39238294 0.39157599 0.39077217 0.38997148 0.38917389 0.3883794 0.38758798 0.38679962 0.38601429 0.38523199 0.3844527 0.3836764 0.38290307 0.3821327 0.38136527 0.38060077 0.37983918 0.37908048 0.37832466 0.37757171 0.3768216 0.37607433 0.37532987 0.37458822 0.37384936 0.37311326 0.37237993 0.37164934 0.37092148 0.37019633 0.36947388 0.36875412 0.36803702 0.36732259 0.3666108 0.36590164 0.36519509 0.36449114 0.36378979 0.36309101 0.36239478 0.36170111 0.36100997 0.36032135 0.35963524 0.35895163 0.35827049 0.35759183 0.35691562 0.35624186 0.35557052 0.35490161 0.3542351 0.35357099 0.35290925 0.35224989 0.35159288 0.35093822 0.35028589 0.34963588 0.34898818 0.34834278 0.34769967] [0.075 0.07500115 0.07500459 0.07501032 0.07501834 0.07502866 0.07504126 0.07505616 0.07507334 0.07509281 0.07511457 0.07513861 0.07516492 0.07519352 0.07522439 0.07525753 0.07529295 0.07533063 0.07537057 0.07541277 0.07545723 0.07550394 0.0755529 0.0756041 0.07565754 0.07571321 0.07577111 0.07583124 0.07589358 0.07595814 0.0760249 0.07609387 0.07616503 0.07623838 0.07631391 0.07639162 0.07647151 0.07655355 0.07663775 0.0767241 0.07681259 0.07690322 0.07699597 0.07709084 0.07718783 0.07728692 0.0773881 0.07749137 0.07759672 0.07770414 0.07781362 0.07792516 0.07803874 0.07815435 0.078272 0.07839165 0.07851332 0.07863699 0.07876264 0.07889028 0.07901989 0.07915145 0.07928497 0.07942043 0.07955782 0.07969713 0.07983835 0.07998147 0.08012649 0.08027338 0.08042214 0.08057277 0.08072524 0.08087956 0.0810357 0.08119366 0.08135342 0.08151499 0.08167833 0.08184346 0.08201035 0.08217899 0.08234938 0.0825215 0.08269534 0.08287089 0.08304814 0.08322708 0.0834077 0.08358998 0.08377392 0.08395951 0.08414673 0.08433558 0.08452603 0.08471809 0.08491174 0.08510697 0.08530377 0.08550213 0.08570204 0.08590348 0.08610645 0.08631094 0.08651693 0.08672441 0.08693338 0.08714381 0.08735571 0.08756907 0.08778386 0.08800008 0.08821772 0.08843677 0.08865722 0.08887906 0.08910228 0.08932686 0.0895528 0.08978009 0.09000872 0.09023867 0.09046994 0.09070251 0.09093638 0.09117154 0.09140797 0.09164567 0.09188463 0.09212483 0.09236628 0.09260894 0.09285283 0.09309793 0.09334422 0.09359171 0.09384037 0.09409021 0.0943412 0.09459335 0.09484664 0.09510107 0.09535662 0.09561328 0.09587106 0.09612993 0.09638989 0.09665093 0.09691304 0.09717621 0.09744044 0.09770571 0.09797202 0.09823936 0.09850772 0.0987771 0.09904747 0.09931884 0.0995912 0.09986454 0.10013885 0.10041412 0.10069035 0.10096753 0.10124564 0.10152469 0.10180467 0.10208556 0.10236735 0.10265005 0.10293365 0.10321813 0.10350349 0.10378973 0.10407683 0.10436479 0.1046536 0.10494325 0.10523374 0.10552506 0.1058172 0.10611016 0.10640393 0.1066985 0.10699387 0.10729003 0.10758697 0.10788469 0.10818318 0.10848244 0.10878245 0.10908321 0.10938472 0.10968697 0.10998995 0.11029365 0.11059808 0.11090323 0.11120908 0.11151563 0.11182289 0.11213083 0.11243947 0.11274878 0.11305876 0.11336942 0.11368074 0.11399272 0.11430535 0.11461863 0.11493256 0.11524712 0.11556231 0.11587813 0.11619457 0.11651162 0.11682929 0.11714757 0.11746644 0.11778592 0.11810598 0.11842664 0.11874787 0.11906969 0.11939207 0.11971503 0.12003855 0.12036262 0.12068726 0.12101244 0.12133817 0.12166444 0.12199125 0.12231859 0.12264646 0.12297485 0.12330376 0.12363319 0.12396314 0.12429359 0.12462454 0.12495599 0.12528794 0.12562038 0.12595331 0.12628673 0.12662062 0.12695499 0.12728983 0.12762514 0.12796092 0.12829716 0.12863386 0.12897101 0.12930861 0.12964666 0.12998516 0.13032409 0.13066346 0.13100327 0.1313435 0.13168416 0.13202525 0.13236676 0.13270868 0.13305102 0.13339377 0.13373692 0.13408048 0.13442444 0.1347688 0.13511356 0.13545871 0.13580424 0.13615017 0.13649647 0.13684316 0.13719022 0.13753766 0.13788547 0.13823365 0.1385822 0.13893111 0.13928038 0.13963 0.13997999 0.14033032 0.14068101 0.14103204 0.14138342 0.14173514 0.1420872 0.1424396 0.14279233 0.1431454 0.14349879 0.14385252 0.14420656 0.14456093 0.14491562 0.14527063 0.14562595 0.14598159 0.14633754 0.14669379 0.14705036 0.14740722 0.14776439 0.14812186 0.14847963 0.14883769 0.14919605 0.14955469 0.14991363 0.15027285 0.15063236 0.15099215 0.15135222 0.15171258 0.1520732 0.15243411 0.15279528 0.15315673 0.15351845 0.15388043 0.15424268 0.1546052 0.15496797 0.15533101 0.1556943 0.15605785 0.15642166 0.15678571 0.15715002 0.15751458 0.15787938 0.15824443 0.15860973 0.15897527 0.15934104 0.15970706 0.16007332 0.16043981 0.16080653 0.16117349 0.16154068 0.1619081 0.16227574 0.16264361 0.16301171 0.16338003 0.16374857 0.16411734 0.16448632 0.16485552 0.16522493 0.16559456 0.1659644 0.16633446 0.16670472 0.16707519 0.16744588 0.16781676 0.16818785 0.16855915 0.16893064 0.16930234 0.16967424 0.17004633 0.17041862 0.17079111 0.17116379 0.17153667 0.17190973 0.17228299 0.17265643 0.17303007 0.17340389 0.17377789 0.17415208 0.17452645 0.17490101 0.17527575 0.17565066 0.17602575 0.17640103 0.17677647 0.1771521 0.17752789 0.17790386 0.17828 0.17865632 0.1790328 0.17940945 0.17978627 0.18016325 0.1805404 0.18091771 0.18129519 0.18167283 0.18205063 0.18242859 0.18280672 0.18318499 0.18356343 0.18394202 0.18432077 0.18469968 0.18507873 0.18545794 0.1858373 0.18621681 0.18659648 0.18697629 0.18735624 0.18773635 0.1881166 0.188497 0.18887754 0.18925822 0.18963905 0.19002002 0.19040113 0.19078238 0.19116377 0.1915453 0.19192697 0.19230877 0.19269071 0.19307278 0.19345499 0.19383733 0.19421981 0.19460242 0.19498515 0.19536802 0.19575102 0.19613415 0.1965174 0.19690079 0.1972843 0.19766793 0.19805169 0.19843558 0.19881959 0.19920372 0.19958798 0.19997235 0.20035685 0.20074147 0.20112621 0.20151106 0.20189604 0.20228113 0.20266634 0.20305166 0.20343711 0.20382266 0.20420833 0.20459412 0.20498001 0.20536602 0.20575214 0.20613837 0.20652471 0.20691117 0.20729773 0.2076844 0.20807118 0.20845806 0.20884505 0.20923215 0.20961935 0.21000666 0.21039408 0.21078159 0.21116921 0.21155694 0.21194476 0.21233269 0.21272072 0.21310885 0.21349707 0.2138854 0.21427383 0.21466235 0.21505098 0.2154397 0.21582851 0.21621743 0.21660644 0.21699554 0.21738474 0.21777403 0.21816342 0.2185529 0.21894247 0.21933213 0.21972189 0.22011174] 2000 0.62
import pylab as pyplt
pyplt.figure()
pyplt.plot(x,y)
[<matplotlib.lines.Line2D at 0x1ed4bf5ff88>]
1.67/5
0.33399999999999996