Revision d59320310b92ca41bd8c4d711c6c2361ae4f0d43 authored by Arthur Tolley on 13 January 2021, 09:55:09 UTC, committed by GitHub on 13 January 2021, 09:55:09 UTC
* Included an option to choose the scipy optimizer, also including the relevant arguments that are needed to customise the optimizers. Changed the default differential_evolution parameters from (100,200) to (50,100).

* Fixing an error

* PR changes, argument choices, making defaults integers, changing some of the help descriptions and the name of the shgo-n argument to shgo-samples.

* Changing from capitals to lower-case for clarity

* Importing the shgo function
1 parent 5349712
Raw File
eventmgr_cython.pyx
import numpy
cimport numpy
from cython import wraparound, boundscheck, cdivision


ctypedef fused REALTYPE:
    float
    double


@boundscheck(False)
@wraparound(False)
@cdivision(True)
def findchirp_cluster_over_window_cython\
        (numpy.ndarray[numpy.int32_t, ndim=1] times,
         numpy.ndarray[REALTYPE, ndim=1] absvalues, int window_length,
         numpy.ndarray[numpy.int32_t, ndim=1] indices, int tlen):
    cdef int j = 0
    cdef int curr_ind = 0
    cdef int i
    
    for i in range(tlen):
        if ((times[i] - times[curr_ind]) > window_length):
            j += 1
            indices[j] = i
            curr_ind = i
        elif (absvalues[i] > absvalues[curr_ind]):
            indices[j] = i
            curr_ind = i
    return j
back to top