Skip to content
Snippets Groups Projects
Commit 8114cf26 authored by Yngve Levinsen's avatar Yngve Levinsen
Browse files

removing * imports

parent 6538c18a
No related branches found
No related tags found
No related merge requests found
Pipeline #9438 passed
...@@ -96,7 +96,7 @@ from __future__ import print_function ...@@ -96,7 +96,7 @@ from __future__ import print_function
#---- Libs #---- Libs
from numpy import * import numpy
import sys import sys
import shutil import shutil
...@@ -110,7 +110,7 @@ c =2.99792458 ...@@ -110,7 +110,7 @@ c =2.99792458
def Brho(gamma): def Brho(gamma):
return (10.0/c)*sqrt(gamma**2-1.0)*mass*1e-3 return (10.0/c)*numpy.sqrt(gamma**2-1.0)*mass*1e-3
class FIELD_MAP_DATA: class FIELD_MAP_DATA:
''' '''
...@@ -123,7 +123,7 @@ class FIELD_MAP_DATA: ...@@ -123,7 +123,7 @@ class FIELD_MAP_DATA:
# Instances # Instances
self.dL =float(lin[0].split()[1])/int(lin[0].split()[0]) self.dL =float(lin[0].split()[1])/int(lin[0].split()[0])
self.field=array(lin[2:], dtype=float) self.field=numpy.array(lin[2:], dtype=float)
self.file_name = file_name self.file_name = file_name
def get_bdsim(self,path): def get_bdsim(self,path):
...@@ -239,10 +239,10 @@ class FIELD_MAP(ELEM): ...@@ -239,10 +239,10 @@ class FIELD_MAP(ELEM):
sys.exit() sys.exit()
# Update gamma (simple ver, closer to TW) # Update gamma (simple ver, closer to TW)
dL=self.data.dL; V=self.Enom*array(self.data.field)*dL; phs=self.phs_rf; C=0.0; S=0.0 dL=self.data.dL; V=self.Enom*numpy.array(self.data.field)*dL; phs=self.phs_rf; C=0.0; S=0.0
for i in range(len(V)): for i in range(len(V)):
C+=V[i]*cos(phs); S+=V[i]*sin(phs); self.gamma+=V[i]/mass*cos(phs) C+=V[i]*numpy.cos(phs); S+=V[i]*numpy.sin(phs); self.gamma+=V[i]/mass*numpy.cos(phs)
beta=sqrt(1.0-1.0/self.gamma**2); phs+=2.0*pi*self.freq*dL/(beta*c*1e2) beta=numpy.sqrt(1.0-1.0/self.gamma**2); phs+=2.0*pi*self.freq*dL/(beta*c*1e2)
# Update gamma (I think this is more accurate...) # Update gamma (I think this is more accurate...)
## dL=self.data.dL; V=self.Enom*array(self.data.field)*dL; phs=self.phs_rf; C=0; S=0 ## dL=self.data.dL; V=self.Enom*array(self.data.field)*dL; phs=self.phs_rf; C=0; S=0
...@@ -258,7 +258,7 @@ class FIELD_MAP(ELEM): ...@@ -258,7 +258,7 @@ class FIELD_MAP(ELEM):
# Option instances for other codes (MADX?) # Option instances for other codes (MADX?)
self.phs_syn=arctan(S/C) self.phs_syn=arctan(S/C)
self.E0TL =C/cos(self.phs_syn) self.E0TL =C/numpy.cos(self.phs_syn)
def get_tw(self): def get_tw(self):
...@@ -544,11 +544,11 @@ class GAP(ELEM): ...@@ -544,11 +544,11 @@ class GAP(ELEM):
# Update gamma (and E0TL) # Update gamma (and E0TL)
if self.beta_s!=0.0 and self.T0!=0.0: if self.beta_s!=0.0 and self.T0!=0.0:
gamma_c =self.gamma+0.5*self.E0TL/mass*cos(self.phs_rf) gamma_c =self.gamma+0.5*self.E0TL/mass*numpy.cos(self.phs_rf)
beta_c =sqrt(1.0-1.0/gamma_c**2) beta_c =numpy.sqrt(1.0-1.0/gamma_c**2)
k =self.beta_s/beta_c k =self.beta_s/beta_c
self.E0TL*=(self.T0+self.T1*(k-1.0)+0.5*self.T2*(k-1.0)**2)/self.T0 self.E0TL*=(self.T0+self.T1*(k-1.0)+0.5*self.T2*(k-1.0)**2)/self.T0
self.gamma+=self.E0TL/mass*cos(self.phs_rf) self.gamma+=self.E0TL/mass*numpy.cos(self.phs_rf)
def get_tw(self): def get_tw(self):
...@@ -636,11 +636,11 @@ class DTL_CEL(ELEM): ...@@ -636,11 +636,11 @@ class DTL_CEL(ELEM):
# Update gamma (and E0TL) # Update gamma (and E0TL)
if self.beta_s!=0.0 and self.T0!=0.0: if self.beta_s!=0.0 and self.T0!=0.0:
gamma_c =self.gamma+0.5*self.E0TL/mass*cos(self.phs_rf) gamma_c =self.gamma+0.5*self.E0TL/mass*numpy.cos(self.phs_rf)
beta_c =sqrt(1.0-1.0/gamma_c**2) beta_c =numpy.sqrt(1.0-1.0/gamma_c**2)
k =self.beta_s/beta_c k =self.beta_s/beta_c
self.E0TL*=(self.T0+self.T1*(k-1.0)+0.5*self.T2*(k-1.0)**2)/self.T0 self.E0TL*=(self.T0+self.T1*(k-1.0)+0.5*self.T2*(k-1.0)**2)/self.T0
self.gamma+=self.E0TL/mass*cos(self.phs_rf) self.gamma+=self.E0TL/mass*numpy.cos(self.phs_rf)
def get_tw(self): def get_tw(self):
...@@ -787,7 +787,7 @@ class BEND(ELEM): ...@@ -787,7 +787,7 @@ class BEND(ELEM):
if self.plane=='0': self.tilt=0.0 if self.plane=='0': self.tilt=0.0
if self.plane=='1': self.tilt=0.5*pi if self.plane=='1': self.tilt=0.5*pi
self.ds =self.rho*abs(self.angle) self.ds =self.rho*abs(self.angle)
self.L =2.0*self.rho*sin(0.5*abs(self.angle)) self.L =2.0*self.rho*numpy.sin(0.5*abs(self.angle))
self.gap =0.0 # Get this from EDGE IF not exporting edge for MADX self.gap =0.0 # Get this from EDGE IF not exporting edge for MADX
self.ff_coef1=0.0 # Get this from EDGE IF not exporting edge for MADX self.ff_coef1=0.0 # Get this from EDGE IF not exporting edge for MADX
self.ff_coef2=0.0 # Get this from EDGE IF not exporting edge for MADX self.ff_coef2=0.0 # Get this from EDGE IF not exporting edge for MADX
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment