...
 
Commits (2)
File added
......@@ -67,7 +67,7 @@ class pypho_cfiber(object):
self.set(fibertype, D, S, gamma, alpha, l, phi_max)
self.E = E
#self.E = E
self.gamma_intern = self.gamma * 1e-3
self.max_step = 200
......@@ -75,10 +75,32 @@ class pypho_cfiber(object):
z = 0
#for Ei in E:
self.fibtrans(z)
#self.fibtrans(z)
#z += 1
print('Start!')
tic0 = time.time()
n = self.glova.sps*self.glova.nos
#Ef_out = np.zeros((1,n)) + 1j*np.ones((1,n))
Ex_out = np.zeros(n) + 1j*np.ones(n)
Ey_out = np.zeros(n) + 1j*np.ones(n)
birefarraydoubles = np.zeros((len(self.birefarray), 3))
for i in range (0, len(self.birefarray)):
birefarraydoubles[i,0] = self.birefarray[i].angle
birefarraydoubles[i,1] = self.birefarray[i].z_point
birefarraydoubles[i,2] = self.birefarray[i].delta_beta
cyfiber(self.glova.sps*self.glova.nos, self.l, np.asarray(E[z]['E'][0]), np.asarray(E[z]['E'][1]),
self.alpha, self.gamma_intern, self.phi_max, birefarraydoubles, len(self.birefarray), self.max_step, self.beta_fac,
np.asarray(1j * scipy.fftpack.fftshift( self.Domega )), Ex_out, Ey_out)
E[z]['E'][0] = Ex_out
E[z]['E'][1] = Ey_out
print ('Fertig: ', time.time() - tic0 )
return self.E
return E
########################################################################
......
......@@ -170,11 +170,15 @@ def cyfiber(int noofsamples,float l, complex[:] E_x, complex[:] E_y, float alpha
#print (lc, zleff[zleff_i], zleff_i, sqrt(exp(-alpha * next_l)))
if lc >= zleff[zleff_i] :
zleff_i +=1
powmean_x = np.mean( Elx[i][0]*Elx[i][0] + Elx[i][1]*Elx[i][1] )
powmean_y = np.mean( Ely[i][0]*Ely[i][0] + Ely[i][1]*Ely[i][1] )
powmean_x = 0
powmean_y = 0
for i in range(noofsamples):
powmean_x += Elx[i][0]*Elx[i][0] + Elx[i][1]*Elx[i][1]
powmean_y += Ely[i][0]*Ely[i][0] + Ely[i][1]*Ely[i][1]
powmean_x /= noofsamples
powmean_y /= noofsamples
powmax_x = np.mean([powmean_x, powmean_y])
#print (powmax_x)
next_leff = phi_max / powmax_x
if next_leff*alpha < 1.0 and alpha > 0.0:
......