Giter Club home page Giter Club logo

inversedistanceweighting.jl's Introduction

InverseDistanceWeighting.jl

THIS PACKAGE IS DEPRECATED

All the functionality has been migrated to GeoEstimation.jl

inversedistanceweighting.jl's People

Contributors

briochemc avatar github-actions[bot] avatar juliohm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inversedistanceweighting.jl's Issues

Using this IDW Interpolator for interpolation a function

Thank you for the implementation of this interpolator.

I wanted to use this interpolator for interpolating values of certain points given initial data.
suppose the value of the function at points is:

coordinate   values of the function at the corresponding point
(1,1)            5
(1,5)            6
(2,6)            7

Now I want to estimate the value of the function at (2,3).
It would be very nice if you can share a notebook with this kind of example.

Thank you!

Using different distance

Maybe I'm doing something wrong, but it seems that changing the distance doesn't work (anymore)? MWE where I just test this with 3 data points and 3 different distances and one case with 1 neighbour. I then plot the solution, which does not seem affected by the distance chosen. What am I missing?

using Plots, GeoStats, InverseDistanceWeighting, Distances
# data
x = [50.0, 100.0, 200.0]
y = [-30.0, 30.0, 10.0]
z = [4.0, -1.0, 3.0]
# list of properties with coordinates
props = OrderedDict(:prop => z)
coord = [(lon,lat) for (lon,lat) in zip(x,y)]
# define spatial data
sdata = PointSetData(props, coord)
# the solution domain (basically a grid covering the entire globe)
dims = (180, 89)
start = (1.0, -89.0)
finish = (359.0, 89.0)
sdomain = RegularGrid(start, finish, dims=dims)
# define estimation problem for any data column(s) (e.g. :precipitation)
problem = EstimationProblem(sdata, sdomain, :prop)
# axes for plots
xs = range(start[1], stop=finish[1], length=dims[1])
ys = range(start[2], stop=finish[2], length=dims[2])
# Plotting solution with data on top
plts = Any[]
tit(x) = string(x.distance, ", neighbours=", x.neighbors)
for NT in [NamedTuple(),
           (distance=Haversine(1.0),),
           (distance=Chebyshev(),),
           (neighbors=1,)]
    solver = InvDistWeight(:variable => NT)
    solution = GeoStats.solve(problem, solver)
    zs = permutedims(reshape(solution.mean[:prop], size(solution.domain)), (2,1))
    plt = contourf(xs, ys, zs)
    scatter!(plt, sdata, title=tit(solver.vparams[:variable]), titlefontsize=10)
    push!(plts, plt)
end
plot(plts..., layout=(2,2))

produces

Screen Shot 2020-06-03 at 2 07 10 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.