Python scipy.signal 模块,find_peaks_cwt() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用scipy.signal.find_peaks_cwt()

项目:object_tracking_simulator_python    作者:yonhdee    | 项目源码 | 文件源码
def data_findpeak(data):

    peakind = signal.find_peaks_cwt(data, np.arange(1,5))

    data_out = np.zeros(scan_range)

    #TODO: data_mask_generate(data,mask)
    for index in peakind:

        data_out[index-1] = 1
        index += 1

    return data_out
项目:object_tracking_simulator_python    作者:yonhdee    | 项目源码 | 文件源码
def data_findpeak(data):

    peakind = signal.find_peaks_cwt(data, np.arange(1,5))

    data_out = np.zeros(scan_range)

    #TODO: data_mask_generate(data,mask)
    for index in peakind:

        data_out[index-1] = 1
        index += 1

    return data_out
项目:radwatch-analysis    作者:bearing    | 项目源码 | 文件源码
def peak_finder_pro(measurement):
    E0 = measurement.energy_cal[0]
    slope = measurement.energy_cal[1]
    energy_axis = measurement.channel
    energy_axis = energy_axis.astype(float)
    energy_axis[:] = [E0 + slope * x for x in range(len(measurement.channel))]

    """energy_spectra is the spectra that will be loaded and analyzed"""

    fwhm_list = []
    for i in energy_axis:
        fwhm = 0.05 * energy_axis[i] ** 0.5
        fwhm_list = fwhm_list.append(fwhm)

    counts = measurement.data

    peaks_found = []
    start = 0
    end = start + 50
    for energy in energy_axis:
        E_start = energy_axis[start]
        E_end = energy_axis[end]
        energy_range = range(E_start, E_end)
        count_total = 0
        for i in energy_range:
            count_total = count_total + counts[energy_range[i]]
        avg_range = count_total/len(energy_range)
        avg_ends = (counts[start] + counts[end]) / 2
        threshold = 1.1 * avg_ends
        if avg_range > threshold:
            energy_average = start + 25
            avg_fwhm = fwhm_list[energy_average]
            width_parameter = avg_fwhm * 3
            wavelet = signal.ricker(width_parameter, avg_fwhm)
            counts_range = range(counts[E_start], counts[E_end])
            wave_transform = signal.cwt(counts_range, wavelet, width_parameter)
            peak_finder = signal.find_peaks_cwt(wave_transform, counts_range)
            peaks_found.append(peak_finder)
            next_range = peak_finder + 0.5 * avg_fwhm
            start = next_range
        else:
            start += 1
        return peaks_found