def local_maxima(vector,min_distance = 4, brd_mode = "wrap"):
    fits = gaussian_filter(numpy.asarray(vector,dtype=numpy.float32),1., mode=brd_mode)
    for ii in range(len(fits)):
        if fits[ii] == fits[ii-1]:
            fits[ii-1] = 0.0
    maxfits     = maximum_filter(fits, size=min_distance, mode=brd_mode)
    maxima_mask = fits == maxfits
    maximum     = numpy.transpose(maxima_mask.nonzero())
    return numpy.asarray(maximum)