interpolate output problems

Issue #29 invalid
Former user created an issue

Hi,

using the peakutils.interpolate function, i am not able to use the optimized peaks in the plot.

import numpy as np
import matplotlib.pyplot as plt
from io import StringIO
import peakutils
from peakutils.plot import plot as pplot
file1 = np.genfromtxt ('file1')
file2 = np.genfromtxt ('file2')
x = file1[:,0]
y = file2[:,1]
x2 = file1[:,0]
y2 = file2[:,1]
indexes1 = peakutils.indexes(y, thres=0.001, min_dist=120)
indexes2 = peakutils.indexes(y2, thres=0.001, min_dist=120)
indexes1_adj = peakutils.interpolate(x, y, ind=indexes1)
indexes2_adj = peakutils.interpolate(x2, y2, ind=indexes2)
plt.figure()
pplot(x, y, indexes1_adj)
pplot(x2, y2, indexes2_adj)
plt.title('test')
plt.show()

Always returns "IndexError: arrays used as indices must be of integer (or boolean) type"

Comments (3)

  1. Lucas Hermann Negri repo owner

    Hi,

    Can you provide small sample files (file1 and file2) so that I can run and verify your code?

  2. Log in to comment