Ejemplo n.º 1
0
    def read_virtual_orbit(self, p_init=None, write2bpms=True):
        """
        searching closed orbit by function closed_orbit(lattice) and searching coordinates of beam at the bpm positions

        :param lattice: class MagneticLattice
        :return: orbit.bpms
        """
        particles = []
        X = []
        Y = []
        if p_init == None:
            self.particle0 = closed_orbit(self.lat)
        else:
            self.particle0 = p_init
        p = copy.copy(self.particle0)
        navi = Navigator(self.lat)
        L = 0.
        for bpm in self.bpms:
            #print("energy = ", p.E)
            dz = bpm.s - L
            tracking_step(self.lat, [p], dz, navi)
            if write2bpms:
                bpm.x = p.x
                bpm.y = p.y
                bpm.E = p.E
                bpm.p = p.p
            L = bpm.s
            X.append(p.x)
            Y.append(p.y)

            particles.append(copy.copy(p))
        #print("energy = ", p.E)
        return np.array(X), np.array(Y),
Ejemplo n.º 2
0
    def read_virtual_orbit(self, p_init=None, write2bpms=True):
        """
        searching closed orbit by function closed_orbit(lattice) and searching coordinates of beam at the bpm positions

        :param lattice: class MagneticLattice
        :return: orbit.bpms
        """
        particles = []
        X = []
        Y = []
        if p_init == None:
            self.particle0 = closed_orbit(self.lat)
        else:
            self.particle0 = p_init
        p = copy.copy(self.particle0)
        navi = Navigator()
        L = 0.
        for bpm in self.bpms:
            #print("energy = ", p.E)
            dz = bpm.s - L
            tracking_step(self.lat, [p], dz, navi)
            if write2bpms:
                bpm.x = p.x
                bpm.y = p.y
                bpm.E = p.E
                bpm.p = p.p
            L = bpm.s
            X.append(p.x)
            Y.append(p.y)

            particles.append(copy.copy(p))
        #print("energy = ", p.E)
        return array(X), array(Y),
Ejemplo n.º 3
0
 def read_virtual_orbit(self, p_init=None):
     """
     searching closed orbit by function closed_orbit(lattice) and searching coordinates of beam at the bpm possitions
     :param lattice: class MagneticLattice
     :return: orbit.bpms
     """
     X = []
     Y = []
     if p_init == None:
         self.particle0 = closed_orbit(self.lat)
     else:
         self.particle0 = p_init
     #print "particle2 = ", self.particle0.s, self.particle0.x
     p = copy.copy(self.particle0)
     navi = Navigator()
     L = 0.
     for bpm in self.bpms:
         #print("energy = ", p.E)
         dz = bpm.s - L
         tracking_step(self.lat, [p], dz, navi)
         bpm.x = p.x
         bpm.y = p.y
         bpm.E = p.E
         L = bpm.s
         X.append(p.x)
         Y.append(p.y)
     #print("energy = ", p.E)
     return array(X), array(Y)