plankton wrote: > Greetings all, > > I rotate a vector field and than I tried to interpolate it to a new grid > using griddata. > > CODE: > > x_grid_unique = unique(x_grid) > y_grid_unique = unique(y_grid) > x_meshgrid, y_meshgrid = meshgrid(x_grid_unique, y_grid_unique) > x_rot_meshgrid = reshape(x_rot, [ len(x_meshgrid[:, 0]), > len(x_meshgrid[0, :])] ) > y_rot_meshgrid = reshape(y_rot, [ len(x_meshgrid[:, 0]), > len(x_meshgrid[0, :])] ) > u_rot_meshgrid = reshape(u_rot, [ len(x_meshgrid[:, 0]), > len(x_meshgrid[0, :])] ) > v_rot_meshgrid = reshape(v_rot, [ len(x_meshgrid[:, 0]), > len(x_meshgrid[0, :])] ) > u_interpolate = griddata(x_rot, y_rot, u_rot, x_rot_meshgrid, > y_rot_meshgrid) > v_interpolate = griddata(x_rot, y_rot, v_rot, x_rot_meshgrid, > y_rot_meshgrid) > > > > I unfortunately griddata returns some nan (It seems that there are multiple > occurrences of the same [X,Y] pair in the data). In matlab you can use > griddata with additional options e.g. ru = > griddata(nx,ny,nu,rx,ry,'linear', {'QJ'}) to fix this, but this seems to be > not possible using the griddata function in matplotlib. Is there any other > way to avoid a return of nan? > > For any help many thanks in advance > > Andreas > > > > Andreas: Can you provide a standalone script that I can run which demonstrates the problem? Otherwise, it's hard to know what's going on.
-Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : jeffrey.s.whita...@noaa.gov 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users