numpy - N-D interpolation for equally-spaced data -


I'm trying to copy the cookie cookbook function:

  From, Sin, MGRID, NDIS, Array X, Y = Ogrid [-1: 5J, -1: 1: 5J] fvals = sin (x) * Sin (Y) NewX, New = MGRID [-1: 1] : 100h, -1: 1: 100 h] x0 = x [0,0] y0 = y [0,0] dx = x [1,0] - x 0 div = y [0,1] - y0 ivals = (New x - x0) / dx jvals = (newy - y0) / dy coords = array ([ivals, jvals]) newf = ndimage.map_coordinates (fvals, coords)   

my For the many scenarios using the function of self To import it as

  import scipy np "" "Nd interpolation for data with similarity" "x = np.c_ [plist ['modx']] y = np. Transbase (np.c_ [plist ['mody']] pdb.set_trace () # newx, newy = np.meshgrid (plist ['newx'], plist ['newy']) newx, newy = scipy.mgrid Plist ['Moddy'] [0]: plist ['modx'] [- 1]: - plist ['remapto'], plist ['mody'] [0]: plist ['mody'] [- 1]: - Plist ['rimphoto']] x0 = x [0,0] y0 = y [0,0] dx = x [1,0] - x d y = y [0,1] - y0 ivals = (new - X0) / DX jvals = (New - y0) / DI Cores = Sipsy. For RA Y ([ivals, jvals]) I am in NP.Range (ivals.shape [0]): nvals [i] = scipy.ndimage .map_coordinates (ivals [i], c ORD)   

I have difficulty in working properly for this code: 1.) Rebuilding this line: New, new = MGRID [-1: 1] : 100h, -1: 1: 100 h] In my case, I have a dictionary with a grid in the form of a vector. I have tried to recreate this line using np.meshgrid, but then I get an error on line cores = scipy.array ([ivals, jvals]). I am looking for some help to re-create this cookbook function and make it more dynamic. Any help is greatly appreciated.

/ m

You should see the documentation. I do not know the actual data that you It's in your code. What do I mean, you probably have some data input which is x and y function; i.e. input = f (x, y) that you want to tease one another in the first example you show, this array is fvals . For the , If the data you are trying to embed is input , which should be 2-times,

  interpolated_data = map_coordinates (input, coordinate )      

Comments