Hey,

Thanks for this. I think I need some way of transposing the data onto a
horizontal plane and then running the interpolation. Would this work maybe?
I really dont know at this stage.
Thanks for your help

On Wednesday, December 11, 2013, Ben Bolker wrote:

>
>     I got a little bit farther.  The results are still very ugly, jagged
> for linear interpolation and with a huge range of values for cubic
> spline extrapolation.  I still don't know about the crash (can't
> reproduce it), but don't know how you expect to be able to extrapolate a
> sensible 3-D surface from points measured along a single narrow 1-D
> curve in the X-Y plane ...  Can you propose *any* software tool/method
> that can do a reasonable job of this?
>
> source("akimatmp2.R")  ## BMB: contents from your data dump below,
>    ## assigned to "dat2"
> dat <- dat2
> nrow(dat)  ## 1500
>
> ## BMB: this makes things a little prettier, but just cosmetic
> dat <- transform(dat,X=X-min(X),Y=Y-min(Y))
> library(rgl)
> library(akima)
> rgl.spheres(dat$X,dat$Z , dat$Y,1,color="red")
> rgl.bbox()
> # bivariate linear interpolation
> # interp:
>
> akima.li <- interp(dat$X, dat$Y, dat$Z,
>                    xo=seq(min(dat$X), max(dat$X), length = 100),
>                    yo=seq(min(dat$Y), max(dat$Y), length = 100),
>                    duplicate="mean")
> # interp surface:
>
> ## BMB: this worked for me once I specified *lowercase* (x,y,z)
> ## rather than *uppercase* (X,Y,Z) elements.
>
> with(akima.li,rgl.surface(x,y,z,color="green",alpha=c(0.5)))
>
> akima.ci0 <- interp(dat$X, dat$Y, dat$Z,
>                    xo=seq(min(dat$X), max(dat$X), length = 100),
>                    yo=seq(min(dat$Y), max(dat$Y), length = 100),
>                    linear=FALSE,
>                    duplicate="mean")
> akima.ci0$z[!is.finite(akima.ci0$z)] <- NA
> with(akima.ci0,image(x,y,z))
> range(na.omit(c(akima.ci0$z)))  ## c() to treat as vector
> ## -250000 to 101000
> range(dat$Z)  ## 3500 to 4400
> summary(na.omit(c(akima.ci0$z)))
> points(dat$X,dat$Y)
>
> rgl.close()
> rgl.spheres(dat$X,dat$Z , dat$Y,1,color="red")
> rgl.bbox()
> with(akima.ci0,rgl.surface(x,y,z,color="green",alpha=c(0.5)))
>
>
> # bivariate cubic spline interpolation
> # interp:
> akima.si <- interp(dat$X, dat$Y, dat$Z,
>                    xo=seq(min(dat$X), max(dat$X), length = 100),
>                    yo=seq(min(dat$Y), max(dat$Y), length = 100),
>                    linear = FALSE, extrap = TRUE,
>                    duplicate="mean")
> with(akima.si,rgl.surface(x,y,z,color="blue",alpha=c(0.5)))
> with(akima.si,image(x,y,z))
> filled.contour(akima.si$x,akima.si$y,akima.si$z)
>
>
> On 13-12-11 11:44 AM, Shane Carey wrote:
> > I want it as one block, if you know what I mean. Like the akima example.
> >
> > Thanks
> >
> >
> > On Wed, Dec 11, 2013 at 4:41 PM, Shane Carey <careys...@gmail.com>
> wrote:
> >
> >> Ok, here is the first 1500 points, but Im giving up hope on it to be
> >> honest.
> >> It seems to be going crazy, creating triangles everywhere. Do the points
> >> need to be evenly spaced?
> >> Thanks for your help.
> >>
> >> structure(list(X = c(9816966.951, 9816963.08, 9816947.516, 9816939.51,
> >> 9816924.005, 9816916.096, 9816901.984, 9816896.967, 9816892.928,
> >> 9816890.743, 9816886.427, 9816884.006, 9816879.185, 9816876.468,
> >> 9816871.027, 9816868.276, 9816863.404, 9816860.712, 9816855.409,
> >> 9816852.487, 9816846.77, 9816843.635, 9816837.53, 9816834.196,
> >> 9816827.733, 9816824.214, 9816817.419, 9816811.926, 9816797.531,
> >> 9816789.588, 9816774.134, 9816765.716, 9816749.492, 9816740.717,
> >> 9816723.946, 9816714.931, 9816697.836, 9816675.781, 9816606.59,
> >> 9816578.983, 9816544.487, 9816531.179, 9816514.376, 9816505.891,
> >> 9816489.52, 9816481.288, 9816465.377, 9816457.374, 9816441.836,
> >> 9816434.026, 9816418.807, 9816411.161, 9816396.205, 9816385.052,
> >> 9816355.719, 9816341.037, 9816312.075, 9816304.796, 9816304.784,
> >> 9816916.962, 9816917.365, 9816918.982, 9816919.414, 9816919.519,
> >> 9816919.545, 9816599.694, 9816615.198, 9816677.27, 9816697.31,
> >> 9816714.671, 9816723.431, 9816740.464, 9816748.995, 9816765.474,
> >> 9816773.661, 9816789.36, 9816797.089, 9816811.764, 9816817.212,
> >> 9816824.113, 9816827.536, 9816834.1, 9816837.345, 9816843.545,
> >> 9816846.596, 9816852.404, 9816855.248, 9816860.635, 9816863.257,
> >> 9816868.198, 9816870.861, 9816876.39, 9816879.039, 9816883.937,
> >> 9816886.296, 9816890.68, 9816892.809, 9816896.829, 9816901.555,
> >> 9816915.878, 9816921.977, 9816931.382, 9816933.721, 9816619.581,
> >> 9816631.77, 9816680.572, 9816697.262, 9816714.648, 9816723.385,
> >> 9816740.441, 9816748.95, 9816765.452, 9816773.618, 9816789.339,
> >> 9816797.049, 9816811.749, 9816817.193, 9816824.103, 9816827.518,
> >> 9816834.092, 9816837.328, 9816843.537, 9816846.58, 9816852.396,
> >> 9816855.233, 9816860.628, 9816863.244, 9816868.191, 9816870.846,
> >> 9816876.383, 9816879.025, 9816883.93, 9816886.284, 9816890.674,
> >> 9816892.798, 9816896.817, 9816901.516, 9816915.859, 9816921.464,
> >> 9816929.009, 9816930.886, 9816639.468, 9816648.343, 9816683.875,
> >> 9816697.215, 9816714.624, 9816723.338, 9816740.418, 9816748.905,
> >> 9816765.43, 9816773.575, 9816789.318, 9816797.009, 9816811.734,
> >> 9816817.175, 9816824.094, 9816827.5, 9816834.083, 9816837.311,
> >> 9816843.528, 9816846.565, 9816852.389, 9816855.218, 9816860.621,
> >> 9816863.23, 9816868.184, 9816870.831, 9816876.376, 9816879.012,
> >> 9816883.924, 9816886.272, 9816890.669, 9816892.787, 9816896.805,
> >> 9816901.477, 9816915.839, 9816920.952, 9816926.637, 9816928.05,
> >> 9816659.354, 9816664.915, 9816687.177, 9816697.167, 9816714.6,
> >> 9816723.291, 9816740.395, 9816748.859, 9816765.407, 9816773.532,
> >> 9816789.298, 9816796.969, 9816811.719, 9816817.156, 9816824.085,
> >> 9816827.482, 9816834.074, 9816837.294, 9816843.52, 9816846.549,
> >> 9816852.381, 9816855.204, 9816860.614, 9816863.217, 9816868.176,
> >> 9816870.816, 9816876.369, 9816878.999, 9816883.918, 9816886.26,
> >> 9816890.663, 9816892.777, 9816896.792, 9816901.438, 9816915.819,
> >> 9816920.439, 9816924.264, 9816925.215, 9816679.241, 9816681.487,
> >> 9816690.48, 9816697.119, 9816714.577, 9816723.244, 9816740.372,
> >> 9816748.814, 9816765.385, 9816773.489, 9816789.277, 9816796.929,
> >> 9816811.705, 9816817.137, 9816824.076, 9816827.464, 9816834.065,
> >> 9816837.277, 9816843.512, 9816846.533, 9816852.373, 9816855.189,
> >> 9816860.607, 9816863.203, 9816868.169, 9816870.801, 9816876.362,
> >> 9816878.985, 9816883.911, 9816886.248, 9816890.657, 9816892.766,
> >> 9816896.78, 9816901.399, 9816915.799, 9816919.926, 9816921.892,
> >> 9816922.38, 9816541.016, 9816548.667, 9816579.391, 9816605.021,
> >> 9816675.293, 9816697.454, 9816714.742, 9816723.572, 9816740.533,
> >> 9816749.131, 9816765.54, 9816773.79, 9816789.422, 9816797.21,
> >> 9816811.808, 9816817.269, 9816824.14, 9816827.589, 9816834.126,
> >> 9816837.395, 9816843.569, 9816846.643, 9816852.427, 9816855.292,
>


-- 
Shane

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to