Exemplo n.º 1
0
Arquivo: lens.py Projeto: ldct/lens
center = (120, 100)

while True:
    
    r1[0] = r1[0] + 1

    refraction_map.clear()
    print "filling"
    make_prism(refraction_map)
    om.fill(geometry.circle(center,50), 1.5)
    om.fill(geometry.circle(center,51), 1.0)
    window.fill((0,0,0))
    print "drawing"
    for (x,y) in reflection_map:
        drawpoint((x,y), (0,0,255))

    for (x,y) in refraction_map:
        if refraction_map[x,y][1] == 1.0:
            drawpoint((x,y), (0,255,255))
        else:
            drawpoint((x,y), (0,255,0))
        if refraction_map[x,y][0] == (0,0):
            drawpoint((x,y), (255,0,0))
    print "rendering"        
    p1 = photon(r1,v,1.0,None)
    for i in range(20):
        draw(p1,om,white)
    print "done"
    
    pygame.display.flip()
Exemplo n.º 2
0
                                     subplot = 122)
ax1b.get_yaxis().set_visible(False)
ax2.get_yaxis().set_visible(False)

# ******************************************************
ax1.plot(r, U1)
ax1.plot([-r0, r0], [-Xe_Z0_Ip, -Xe_Z0_Ip], '-m', label = '5p')

# Electron
ax1.plot([0.0], [-Xe_Z0_Ip], 'og', ms = 14)

# Photon
gamma = 0.5*Xe_Z0_Ip
ar_e1 = fleches.arrow('e1', [0.0, -Xe_Z0_Ip], [0.0, gamma-Xe_Z0_Ip])
ar_e1.Plot(ax1, color = 'b', alpha = 0.5)
photon(ax1, [r[0]+lr*0.1, -Xe_Z0_Ip], [0.0, -Xe_Z0_Ip], Xe_Z0_Ip/5.0, alpha = 0.5)
ax1.plot([0.0], [gamma/2.0 - Xe_Z0_Ip], 'xr', ms = 30, markeredgewidth = 3)



# ******************************************************
Uep = -1.5*Xe_Z0_Ip
ax2.plot(r, U2)
ax2.plot([-r0, r0], [Uep, Uep], '-m', label = '5p')

# Electron
ax2.plot([0.0], [Uep], 'og', ms = 14, alpha = 0.6)
ax2.plot([0.0], [Uep+gamma], 'og', ms = 14  )

# Photon
gamma = 0.5*Xe_Z0_Ip
Exemplo n.º 3
0
# Photon energy
ar1 = fleches.arrow('GammaE', [0.0, -Xe_Z0_Ip], [0.0, GammaE-Xe_Z0_Ip])
ar1.Plot(ax1, color = 'r', label = r'$E_\gamma$', horizontalalignment = 'left')
ax1.plot([0.0], [-Xe_Z0_Ip], 'ob', ms = 14, alpha = 0.6)

# New electron velocity
ar2 = fleches.arrow('N_e', [0.0, GammaE-Xe_Z0_Ip], [5.0, GammaE-Xe_Z0_Ip])
ar2.Plot(ax1, color = 'b', label = '$v_e$', horizontalalignment = 'center', verticalalignment = 'bottom')
ax1.plot([0.0], [GammaE-Xe_Z0_Ip], 'ob', ms = 14)

# Delta E
x = -1.0
ar3 = fleches.arrow('D_e', [x, 0.0], [x, GammaE-Xe_Z0_Ip])
ar3.Plot(ax1, color = 'g', label = '$\Delta E.$', horizontalalignment = 'right', bidirectional = True)

# Photon
#photon(ax1, [r[0]+lr*0.1, -Xe_Z0_Ip/2.0], [0.0, -Xe_Z0_Ip/2.0], Xe_Z0_Ip/5.0)
photon(ax1, [r[0]+lr*0.1, -Xe_Z0_Ip], [0.0, -Xe_Z0_Ip], Xe_Z0_Ip/5.0)

ax1.set_xlim((r[0], r[-1]))
ax1.set_ylim((Umin, Umax))

ax1.set_xlabel('r [bohr]')
ax1.set_ylabel('Energy [Hartree]')

for ext in ['pdf', 'svg']:
    plot.savefig('ionization_single.' + ext)
plot.show()

Exemplo n.º 4
0
            else:
                ax.add_patch(mpatches.Circle([x,y], r_e, color='blue', ec="none", alpha=0.6))


# *******************************************************************************************
# Auger 1st step

# Outer shells still intact
ax1.add_patch(mpatches.Circle(auger_2_xy, r_e, color='blue', ec="none", alpha=0.6))
ax1.add_patch(mpatches.Circle(auger_3_xy, r_e, color='blue', ec="none", alpha=0.6))

# New hole in inner shell filling
ax1.add_patch(mpatches.Circle(auger_1_xy, r_e, color='none', ec="blue", lw = 2, ls = 'dotted'))

# Photon hitting inner shell
photon(ax1, [auger_1_xy[0]-photon_length, auger_1_xy[1]], auger_1_xy, 1.0)

# Inner shell electron leaving
auger_1_xy_new = np.array([None]*2)
angle = np.arctan2(auger_1_xy[1], auger_1_xy[0]) * 0.8
auger_1_xy_new[0] = 1.3 * el_r.max() * np.cos(angle)
auger_1_xy_new[1] = 1.3 * el_r.max() * np.sin(angle)
ax1.add_patch(mpatches.Circle(auger_1_xy_new, r_e, color='blue', ec="none", alpha=1.0))

# Arrow showing it
ar = arrow('AuE', auger_1_xy, auger_1_xy_new)    # Vertical (Ke)
ar.Plot(ax1, color = 'g')


# *******************************************************************************************
# Auger 2nd step