You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find much documentation on this and the README is both bare-bones and pretty opaque. A real-world use case would help.
The following is my naive attempt. I know it's wrong but it will be useful to show what I need. Also note that the grid spacing of the known data is not even. (By the way, here is my working example using python.)
I am also interested in extrapolating values outside of the known data bounds. Is the ndarray-linar-interpolate library capable of that?
varndarray=require("ndarray");varinterp=require("ndarray-linear-interpolate");// Create the 2D ndarray object from the given data// The first column is "diameter in inches" and the first row is "psi"// The first cell (A:1)is a dummy valuevardata=ndarray(newFloat32Array([0,60,120,240,360,480,4,71,100,142,173,200,6,106,150,212,260,300,8,142,200,283,347,400,10,177,250,354,433,500,12,212,300,425,520,601,14,248,350,495,607,701,16,283,400,566,693,801,18,318,450,637,780,901,20,354,500,708,867,1001,22,389,550,779,953,1101]),[10,6]);console.log(interp(data,4.1,61));// x=4.1 inches, y=61 psi. expect a value of a little over 72 but it returns 0.
The text was updated successfully, but these errors were encountered:
Soon after I posted, I bailed and went with Python / scipy / RegularGridInterpolator, which was documented, relatively easy to work with, and supported extrapolation outside of known data.
I can't find much documentation on this and the README is both bare-bones and pretty opaque. A real-world use case would help.
The following is my naive attempt. I know it's wrong but it will be useful to show what I need. Also note that the grid spacing of the known data is not even. (By the way, here is my working example using python.)
I am also interested in extrapolating values outside of the known data bounds. Is the
ndarray-linar-interpolate
library capable of that?The text was updated successfully, but these errors were encountered: