interpolation

problematic Moire pattern in image produced with gnuplot pm3d and pdf output

社会主义新天地 提交于 2019-11-26 11:38:15
问题 I\'m plotting data using the command files discussed here: gnuplot contour line color: set style line and set linetype not working I want to provide different output options. PNG works well, as does the wxt terminal, however, these have fixed resolution, e.g. when I \"zoom in\" on the plot it gets grainier. If I use pdf or pdfcairo for the terminal, the resulting file has a Moire pattern. The region in the image over which the Moire pattern is observed can be reduced by using increasing

Interpolate NA values in a data frame with na.approx

て烟熏妆下的殇ゞ 提交于 2019-11-26 10:55:39
问题 I am trying to remove NA s from my data frame by interpolation with na.approx() but can\'t remove all of the NA s. My data frame is a 4096x4096 with 270.15 as flag for non valid value. I need data to be continous in all points to feed a meteorological model. Yesterday I asked, and obtained an answer, on how to replace values in a data frame based in another data frame. But after that I came to na.approx() and then decided to replace the 270.15 values with NA and try na.approx() to interpolate

Speedup scipy griddata for multiple interpolations between two irregular grids

大憨熊 提交于 2019-11-26 10:35:59
问题 I have several values that are defined on the same irregular grid (x, y, z) that I want to interpolate onto a new grid (x1, y1, z1) . i.e., I have f(x, y, z), g(x, y, z), h(x, y, z) and I want to calculate f(x1, y1, z1), g(x1, y1, z1), h(x1, y1, z1) . At the moment I am doing this using scipy.interpolate.griddata and it works well. However, because I have to perform each interpolation separately and there are many points, it is quite slow, with a great deal of duplication in the calculation

Interpolation over an irregular grid

て烟熏妆下的殇ゞ 提交于 2019-11-26 10:34:10
问题 So, I have three numpy arrays which store latitude, longitude, and some property value on a grid -- that is, I have LAT(y,x), LON(y,x), and, say temperature T(y,x), for some limits of x and y. The grid isn\'t necessarily regular -- in fact, it\'s tripolar. I then want to interpolate these property (temperature) values onto a bunch of different lat/lon points (stored as lat1(t), lon1(t), for about 10,000 t...) which do not fall on the actual grid points. I\'ve tried matplotlib.mlab.griddata,

How Do I Generate a 3-D Surface From Isolines?

跟風遠走 提交于 2019-11-26 09:53:03
问题 I have a set of isoline points (or contour points) such as this: alt text http://www.rcad.eu/triang&isolines%20example1.jpg Each point on an isoline has its own respective X, Y, and Z coordinate. Since they are isolines, that means that each point will have a unique X-Y pair, but points on the same line will have the same Z coordinate. Now, is there any algorithm or any software packages (either in C# or C++ or MATLAB) that I can use to interpolate the isoline points into a full 3-D surface?

Interpolate NA values

烂漫一生 提交于 2019-11-26 09:46:09
问题 I have two set of samples that are time independent. I would like to merge them and calculate the missing values for the times where I do not have values of both. Simplified example: A <- cbind(time=c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100), Avalue=c(1, 2, 3, 2, 1, 2, 3, 2, 1, 2)) B <- cbind(time=c(15, 30, 45, 60), Bvalue=c(100, 200, 300, 400)) C <- merge(A,B, all=TRUE) time Avalue Bvalue 1 10 1 NA 2 15 NA 100 3 20 2 NA 4 30 3 200 5 40 2 NA 6 45 NA 300 7 50 1 NA 8 60 2 400 9 70 3 NA 10 80 2

AngularJS multiple expressions concatenating in interpolation with a URL

巧了我就是萌 提交于 2019-11-26 09:36:11
问题 I know this is long, but please bear with me. The problem is easy to understand, just takes some writing to fully explain it. Right now I\'m getting this error Error: [$interpolate:noconcat] Error while interpolating: Strict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce I\'ve done all the reading in the documentation, but I still can\'t find a workaround for my problem. I\'m using

extracting a quadrilateral image to a rectangle

久未见 提交于 2019-11-26 09:29:11
问题 BOUNTY UPDATE Following Denis\'s link, this is how to use the threeblindmiceandamonkey code: // the destination rect is our \'in\' quad int dw = 300, dh = 250; double in[4][4] = {{0,0},{dw,0},{dw,dh},{0,dh}}; // the quad in the source image is our \'out\' double out[4][5] = {{171,72},{331,93},{333,188},{177,210}}; double homo[3][6]; const int ret = mapQuadToQuad(in,out,homo); // homo can be used for calculating the x,y of any destination point // in the source, e.g. for(int i=0; i<4; i++) {

Generate colors between red and green for a power meter?

元气小坏坏 提交于 2019-11-26 08:39:37
问题 I\'m writing a Java game and I want to implement a power meter for how hard you are going to shoot something. I need to write a function that takes a int between 0 - 100, and based on how high that number is, it will return a color between Green (0 on the power scale) and Red (100 on the power scale). Similar to how volume controls work: What operation do I need to do on the Red, Green, and Blue components of a color to generate the colors between Green and Red? So, I could run say, getColor

get x-value given y-value: general root finding for linear / non-linear interpolation function

久未见 提交于 2019-11-26 08:31:05
问题 I am interested in a general root finding problem for an interpolation function. Suppose I have the following (x, y) data: set.seed(0) x <- 1:10 + runif(10, -0.1, 0.1) y <- rnorm(10, 3, 1) as well as a linear interpolation and a cubic spline interpolation: f1 <- approxfun(x, y) f3 <- splinefun(x, y, method = \"fmm\") How can I find x -values where these interpolation functions cross a horizontal line y = y0 ? The following is a graphical illustration with y0 = 2.85 . par(mfrow = c(1, 2))