Feb-04-2020, 08:43 AM
(This post was last modified: Feb-04-2020, 08:43 AM by player1681.)
Hello everybody. I have a .txt file in which a grid of X and Y points and values of f(X, Y) in said grid are constructed as columns. I am trying to program the Shannon Interpolation. For that I need to do the regular interpolation on the grid. To do it, first I construc three lists of values as
Can someone assist me?
Regards.
EDIT: I have tested with a smaller set of points and the program runs well enough. Therefore my issue is not a syntax one, but the fact that I am using plenty of points. I would need a way to speed up my process.
f = open('XdataTXT.txt','r') linesX=f.readlines() X_column_number = 0 positionX=[] Y_column_number = 1 positionY=[] WindX_column_number=2 windX=[] for x in linesX: positionX.append(float(x.split()[X_column_number])) positionY.append(float(x.split()[Y_column_number])) windX.append(float(x.split()[WindX_column_number])) f.close()Then I try to do the regular interpolation as defined here
windXInterpFunc = interpolate.interp2d(positionX, positionY, windX, kind='cubic')However, when I run this, python just keeps running without finishing, doesn't matter how long I leave the program running.
Can someone assist me?
Regards.
EDIT: I have tested with a smaller set of points and the program runs well enough. Therefore my issue is not a syntax one, but the fact that I am using plenty of points. I would need a way to speed up my process.