Message Boards Message Boards

Generalizing the usage of BSplineFunction fron 1D to 2D

Posted 4 years ago

Hello everyone. Some time ago I wrote a code that adds some values to the beggining of a vector of data (X, f(X)=Y) which is later used for Shannon interpolation as follows:

data = sample;
data = SortBy[data, 
   First];(* just in case time data is not properly sorted *)
{xmin, leftY} = 
  First@data;  (* saving data min *)
{xmax, rightY} = 
  Last@data ;(* saving data max *)
dDelta = (xmax - xmin)/
   20; (* step *)
leftF = BSplineFunction[{{xmin, leftY}, {xmin - dDelta, 
     leftY - dDelta (rightY - leftY)/(xmax - xmin)}, {xmin - 2 dDelta,
      0}, {xmin - 3 dDelta, 0}}]; 

Now, I need to do a similar interpolation, but in 2D, meaning that now the dimensions of data are n3 (X, Y, f(X,Y)) instead of n2 and I don't know how to adapt the code for leftF to work with 2D data.

POSTED BY: Jaime de la Mota
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract