@@ -223,16 +223,16 @@ class RFBucketAperture(Aperture):
223223
224224@ cython.boundscheck (False )
225225@ cython.wraparound (False )
226- cpdef cytag_lost_rectangular(double [::1 ] u, unsigned int [::1 ] alive,
226+ cpdef cytag_lost_rectangular(double [::1 ] u, int [::1 ] alive,
227227 double low_lim, double high_lim):
228228 ''' Cython function for fast identification and tagging of particles
229229 lost at a rectangular aperture element, i.e. it tags particles with
230230 a spatial coord u (beam.x, beam.y or beam.z) lying outside the
231231 interval (low_lim, high_lim) as lost. Returns whether or not any
232232 lost particles were found. '''
233- cdef unsigned int n = alive.shape[0 ]
234- cdef unsigned int losses = 0
235- cdef unsigned int i
233+ cdef int n = alive.shape[0 ]
234+ cdef int losses = 0
235+ cdef int i
236236 for i in xrange (n):
237237 if u[i] < low_lim or u[i] > high_lim:
238238 alive[i] = 0
@@ -242,16 +242,16 @@ cpdef cytag_lost_rectangular(double[::1] u, unsigned int[::1] alive,
242242@ cython.boundscheck (False )
243243@ cython.wraparound (False )
244244cpdef cytag_lost_circular(
245- double [::1 ] u, double [::1 ] v, unsigned int [::1 ] alive,
245+ double [::1 ] u, double [::1 ] v, int [::1 ] alive,
246246 double radius_square):
247247 ''' Cython function for fast identification and tagging of particles
248248 lost at a circular transverse aperture element of a given radius,
249249 i.e. it tags particles with spatial coords u, v (usually (beam.x,
250250 beam.y)) fulfilling u**2 + v**2 > radius_square as lost. Returns
251251 whether or not any lost particles were found. '''
252- cdef unsigned int n = alive.shape[0 ]
253- cdef unsigned int losses = 0
254- cdef unsigned int i
252+ cdef int n = alive.shape[0 ]
253+ cdef int losses = 0
254+ cdef int i
255255 for i in xrange (n):
256256 if (u[i]* u[i] + v[i]* v[i]) > radius_square:
257257 alive[i] = 0
0 commit comments