python - Interpolating a difficult surface with a B-spline (scipy.interpolate.bisplrep) -


i using scipy.interpolate bisplrep , bisplev interpolate 2d vector field. problem spline values @ test points vary far given values @ points (can't trust tck of bisplrep). vector field highly discontinuous in region. cutting out region, have improved interpolation bit, not enough.

here picture of every 100th ray of 2967, point ray exits discontinuous area, , general area interested in evaluating @ (green)

my vector field, area of interest in green.

to points feed bisplrep, took each of 3000 rays , made 100 points along line, starting @ point ray exits discontinuous area , ending 400 units later (roughly box shows, oblong circular). so, cut out discontinuous area not taking samples there. not grid, oblong semicircle donut of points. have default value put in mixed region, highly discontinuous @ boundary.

the values angle of line according arctan2.

here how call bisplrep:

#pts numpy array of points sampled within green area values = lookup_values(pts) m = pts.shape[0]   tck=bisplrep(pts[:,0],pts[:,1],values,kx=3,ky=3,s=m-np.sqrt(2*m)) 

i changed kx,ky 3,4,5. changed s between m-np.sqrt(2m) , m+np.sqrt(2m) docs suggested. neither of these changes make difference (changing order of spline makes no difference).

comparing interpolated values real known values, .001 < ((real-interpolated) / real) < .95 throughout region interested in. here image of error is, error represented gray scale: error of .001 = white, error of .95 = black (sorry, same boundary of discontinuous region represented black points)

plot of error intensity @ locations

i'm not sure makes set of input data bisplrep. many points (just under 3 hundred thousand)? few? area of points sampled irregular? vector field irregular? how can interpolate values within vector field?


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -