interpolation

How to produce X values of a stretched graph?

孤者浪人 提交于 2019-12-13 18:06:53
问题 I'm trying to "normalize" monthly data in a way. What I mean by that is, I need to take daily values and check the data from each month against the data in another month. The only problem with this is that some months are longer than others. So I have come up with a way that I want to do this, but I'm kind of confused as to exactly how to do it... Basically, I'm looking at this website: http://paulbourke.net/miscellaneous/interpolation/ and trying to transform each set of coordinates into a

interpolate python array to minimize maximum difference between elements

别说谁变了你拦得住时间么 提交于 2019-12-13 14:19:17
问题 What is a concise and readable way of interpolating a 1D array such that the maximum difference between elements is minimized? For instance, if I had the array [4 9 13 25] and I was allowed to add 1 more number in order to minimize the maximum difference between elements I would insert a 19 between 13 and 25 (max difference is now 6 rather than 12). Of course a good ole' for loop will get it done, but for posterity is there a less verbose approach than below? # current array nums = np.array(

How to interpolate through 3 points/numbers with a defined number of samples? (in c#)

£可爱£侵袭症+ 提交于 2019-12-13 09:15:51
问题 So for example we have 1, 5, and 10 and we want to interpolate between these with 12 points, we should get: 1.0000 1.7273 2.4545 3.1818 3.9091 4.6364 5.4545 6.3636 7.2727 8.1818 9.0909 10.0000 say we have 5, 10, and 4 and again 12 points, we should get: 5.0000 5.9091 6.8182 7.7273 8.6364 9.5455 9.4545 8.3636 7.2727 6.1818 5.0909 4.0000 回答1: This is a generalized solution that works by these principles: Performs linear interpolation It calculates a "floating point index" into the input array

Get quantitative value for color on two-color scale

怎甘沉沦 提交于 2019-12-13 08:06:10
问题 I have run a chemical test that produces a color depending on how much of a given chemical is in the sample. It is green if there is no chemical, and yellow if there is a saturating amount of chemical. I have used my camera to take pictures of several samples, and also developed a standard curve, where I add known amounts of chemical to the test, and take pictures of the results to compare the color of the result of my sample to these standards. What I would like to do, is develop an

Integrating over a PCHIP Function

陌路散爱 提交于 2019-12-13 07:34:16
问题 How can I integrate over a PCHIP (Piecewise Cubic Hermite Interpolation Polynomial) function in R? pchip {pracma} returns interpolated point data, and to integrate we of course need a function. I see under the help menu for pchip(), "TODO: A `pchipfun' should be provided," I don't know how hard this would be to generate manually? Any other suggestions? You could fit an nth degree polynomial regression to the interpolated points and integrate off that to get a rough approximation, but that

Interpolation of values when zooming down

巧了我就是萌 提交于 2019-12-13 04:42:23
问题 I have a 2D array that I would like to down sample to compare it to another. Lets say my array x is 512x512 , I'd like an array y 128x128 where the elements of y are build using an interpolation of the values overs 4x4 blocks of x (this interpolation could just be taking the average, but other methodes, like geometric average, could be interesting) So far I looked at scipy.ndimage.interpolation.zoom but I don't get the results I want >> x = np.arange(16).reshape(4,4) >> print(x) [[ 0 1 2 3] [

R mapping filled.contour georeferencing interpolation

天大地大妈咪最大 提交于 2019-12-13 01:54:25
问题 I'm trying to make a map kind of like this, but with higher resolution, and less of a tile like appearance: Which used this code: samps <- read.csv("Petra_phytoplankton+POM_xydata_minusNAs_noduplicates.csv") #my data for sampling sites, contains a column of "lat" and a column of "lon" with GPS points in decimal degrees samps_test<-samps x<-samps_test$longitude y<-samps_test$latitude z<-samps_test$d13C ## interpolation using akima x0<-seq(min(x), max(x), length = 100) y0<-seq(min(y), max(y),

Python implementation of bilinear quadrilateral interpolation

时间秒杀一切 提交于 2019-12-13 01:39:29
问题 I'm trying to perform bilinear quadrilateral interpolation. So I have four nodes with known values and I want to find a value that lies in between those four nodes by interpolation, but the four nodes do not form a rectangle. 4-node sketch I found several ways to solve this, but none of them is implemented in Python already. Does there exist somewhere an already finished python implementation? If not which of the two solutions below would you recommend? Or would you recommend another approach

2D interpolation using TriScatteredInterp (Matlab)

六眼飞鱼酱① 提交于 2019-12-13 00:48:46
问题 Let us consider I have a set of points, which are described as a pair of 2D coordinates. At every single point, I have the value of a given parameter, let us say, temperature. Point 1 : (x1, y1, t1) Point 2 : (x2, y2, t2) ... Point n : (xn, yn,tn) All those points are contained within a 2D domain which is shaped as a triangle. I would like to interpolate parameter t within the extend of the entire domain. Any interpolation method (linear, nearest neighbors,...) would be fine, to me. I am

Find Y value of an interpolated point in a Linestring given an X value on Postgis

倾然丶 夕夏残阳落幕 提交于 2019-12-13 00:03:04
问题 I would like to know what's the best way to find the Y value of an interpolated point inside the Linestring , when given the X . The X coordinates of my input Linestring will always be incremental and non sequential (as in the example below). The Y values could be any real number. LINESTRING(223 -59,228 -59.3,233 -59.7,242 -60,263 -60.4, 268 -61.7,275 -62.1,280 -62.5) Given an X value (let's say 270 for example), the query would output the interpolated value inside the Linestring (in this