How to interpolate to equidistant axis in for-loop?

s_max = frequency value maximum
s_min = frequency value minimum

spec = 2D-Array: row represent propagation steps, columns represent Energie(frequency). This means for eachs step there is a spectrum.

number of steps = 100

x = np.linspace(3e8/s_max, 3e8/s_min, np.size(spec,1))
scale = 1 #x*x
n = 100
for i in range (0, n):
spec_neu= scipy.interpolate.interp1d(x, spec[i,:]*scale, 'linear')

fig2 = plt.figure()
bx2 = fig2.add_subplot(122)

# draw the spectrum

bx2.set_xlabel('frequency (THz)')
bx2.set_ylabel('distance (m)')

But Error occurs:
TypeError: Image data of dtype object cannot be converted to float



Please sign in to leave a comment.