def __init__(self,pathList,radii, isALoop=False): """ A list of vector points that the tube traverses and the radii that it has at those points. The orientation of the circles of the tube must be such that they are the average of the two orientations of the lineseg on either path leading into the section. If this is not a closed loop then the start and end circles are just oriented with the one segment with which they are associated. If this is a loop, we close the tube back at the starting point. """ # We need to figure out the line segments # and the direction that the circle points. attributesFromDict(locals()) self.segs=[] for i in range(len(pathList)-1): A=pathList[i] B=pathList[i+1] self.segs.append(LineSeg(A,B)) # now the directions at a point self.pointDirections=[self.segs[0].unitvector()] for i in range(len(self.segs)-1): # skip last segment A=self.segs[i].unitvector() B=self.segs[i+1].uintvector() avg=(A+B).scale(0.5) self.pointDirections.append(avg) self.pointDirections.append(self.segs[-1].unitvector())
def __init__(self,centervect,lvect,hvect,wvect): #wvect=lvect.cross(hvect).unitvector() #wvect=wvect.scale(width) length=lvect.length() height=hvect.length() width=wvect.length() attributesFromDict(locals())
def __init__(self,xyzStart,xyzEnd, radius=0.001, numSplit=1, # I2 load=None # A load as on page 58 of the manual. ): """ The tag number is calculated automatically in NECModel """ attributesFromDict(locals())
def __init__(self, thetaS=0,thetaE=pi,numTheta=8, phiS=0,phiE=2*pi,numPhi=8, r=None, outputFormat="VERTHORIZ", #VERTHORIZ or MAJORMINOR | X in XNDA gainNormalization="NONE", #NONE, MAJOR, MINOR, VERT, HORIZ, or TOTAL | N in XNDA gainType="POWER", #POWER or DIRECTIVE | D in XNDA gainAveraging=False, #True or False. We forget A=2. | A in XNDA ): dTheta=(thetaE-thetaS)/float(numTheta-1) dPhi=(phiE-phiS)/float(numPhi) # No minus one because of the wrap around. attributesFromDict(locals())
def __init__(self,description="My Model\n Is here.", geometry={"wiresegs":[] # A straight list of the wiresegments }, excitation=None, freq=LinearFrequencyRange(), radiationPattern=None, computeCharges=True): """ The geometry is a list of KGeomVisualization Objects. These objects can be viewed and can be simulated. """ attributesFromDict(locals())
def __init__(self, segnum, # I2 segsplit=1, # I3 extype="APPLIED_EFIELD", calcMaxAdmittanceMatrixAssym=0, # I4 first param calcImpedanceTable=1, # I4 second param VReal=1.0, VImag=0.0, ImpedanceNormalization=None ): """ APPLIED_EFIELD or CURRENTSLOPE """ attributesFromDict(locals())
def __init__(self, R=0.162, #0.16 #0.165 too big #radius meters Z=0.26, #length meters numZ=50,#64, #T20 50 #number of segmentation numPhi=36,#64, #T20 36 #number of segmentation HarmBW=4, #shm spherical harmonic max magLimitPerArea=0.3, #T20 magLimit =0.05 #magnetization max fname="fout", #depends on the name of spherical harmonics ShimFieldHarmonics={(2,2):(6,0), (2,0):(6,0)}): fname=fname+".cPickle" self.dz=Z/(numZ-1) self.dphi=2*pi/(numPhi) # No -1 because the topology is circular PixelArea=self.dz*R*self.dphi magLimitPerPixel=magLimitPerArea*PixelArea attributesFromDict(locals())
def __init__(self,centerVector,areaVector,lengthVector): """ centerVector is a vector describing where the center is lengthVect is a vector describing the direction of the long axis and its length areaVector is a vector describing the 'direction' of the area N1-N4 count counter-clockwise about the areaVector """ attributesFromDict(locals()) self._N1=None self._N2=None self._N3=None self._N4=None self.widthVector=(self.areaVector%(self.lengthVector.unitvector())).scale(1.0/float(self.lengthVector.length()))
def __init__(self, center, start_angle, end_angle, radius, axis=Vector((0,0,1)), _ClassName_="Arc", ): attributesFromDict(locals()) # our job is now to figure out the startpos and endpos lseg=LineSeg(center,center+axis) r0,rperp=lseg.two_orthonorm() r0=r0.scale(radius) if (axis-Vector((0,0,1))).length() >= 1e-9: raise Exception rotA=find_yaw_transform(start_angle) #rotA=find_rotation_about_axis(axis,start_angle) print "rotA",rotA self.startvect=center+r0.rotate(rotA) rotB=find_yaw_transform(end_angle) #rotB=find_rotation_about_axis(axis,end_angle) self.endvect=center+r0.rotate(rotB)
def __init__(self,Port1TAG,Port2TAG,Port1SEG=1,Port2SEG=1,Z0=50.0,length=None, Port1ShuntAdmittance=complex(0,0),Port2ShuntAdmittance=complex(0,0)): attributesFromDict(locals())
def __init__(self,Port1TAG,Port2TAG,YMatrix,Port1SEG=1,Port2SEG=1): attributesFromDict(locals())
def __init__(self): attributesFromDict(locals())
def __init__(self, impedance, # complex number (ohms) LDTAGF=0,LDTAGT=None ): attributesFromDict(locals())
def __init__(self,patchPositions,fieldPointsAndVals): attributesFromDict(locals())
def __init__(self,points): if len(points)!=3: raise Exception attributesFromDict(locals())
def __init__(self, R=0, # Resistance Ohms L=0, # Inductance Henries C=0, # Capacitance Farads LDTAGF=0,LDTAGT=None): attributesFromDict(locals())
def __init__(self,extype="LINEAR"): """ LINEAR,RIGHTELLIPTIC,LEFTELLIPTIC """ attributesFromDict(locals())
def __init__(self,freq=299.8e6,dfreq=1.1,num=1): attributesFromDict(locals())
def __init__(self, conductivity, # mhos/meter LDTAGF=0,LDTAGT=None ): attributesFromDict(locals())
def __init__(self,vects): if(len(vects)<2): raise Exception attributesFromDict(locals())