def _sigma(self, u):
        
        index = self.first_particle_index_in_slice
        stats = np.zeros(self.n_slices)
        for i in xrange(self.n_slices):
            k  = u[index[i]:index[i + 1]]
            stats[i] = cp.std(k)

        return stats
Exemple #2
0
    def _sigma(self, u):

        index = self.first_particle_index_in_slice
        stats = np.zeros(self.n_slices)
        for i in xrange(self.n_slices):
            k = u[index[i]:index[i + 1]]
            stats[i] = cp.std(k)

        return stats
    def _set_longitudinal_cuts(self, bunch):

        if self.nsigmaz == None:
            z_cut_tail = bunch.z[0]
            z_cut_head = bunch.z[-1 - bunch.n_macroparticles_lost]
        else:
            mean_z = cp.mean(bunch.z[:bunch.n_macroparticles - bunch.n_macroparticles_lost])
            sigma_z = cp.std(bunch.z[:bunch.n_macroparticles - bunch.n_macroparticles_lost])
            z_cut_tail = mean_z - self.nsigmaz * sigma_z
            z_cut_head = mean_z + self.nsigmaz * sigma_z

        return z_cut_tail, z_cut_head
Exemple #4
0
    def _set_longitudinal_cuts(self, bunch):

        if self.nsigmaz == None:
            z_cut_tail = bunch.z[0]
            z_cut_head = bunch.z[-1 - bunch.n_macroparticles_lost]
        else:
            mean_z = cp.mean(bunch.z[:bunch.n_macroparticles -
                                     bunch.n_macroparticles_lost])
            sigma_z = cp.std(bunch.z[:bunch.n_macroparticles -
                                     bunch.n_macroparticles_lost])
            z_cut_tail = mean_z - self.nsigmaz * sigma_z
            z_cut_head = mean_z + self.nsigmaz * sigma_z

        return z_cut_tail, z_cut_head
Exemple #5
0
 def sigma_dp(self):
     return cp.std(self.dp)
Exemple #6
0
 def sigma_y(self):
     return cp.std(self.y)
Exemple #7
0
 def sigma_z(self):
     return cp.std(self.z)
Exemple #8
0
 def sigma_x(self):
     return cp.std(self.x)
 def sigma_dp(self):
     return cp.std(self.dp)
 def sigma_z(self):
     return cp.std(self.z)
 def sigma_y(self):
     return cp.std(self.y)
 def sigma_x(self):
     return cp.std(self.x)