Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I interpolate georeferenced data in python?

I have many lines of georeferenced hydrological data with weekly resolution:

Station name, Lat, Long, Week 1 average, Week 2 average ... Week 52 average

Unfortunately, I also have some data with only monthly resolution:

Station name, Lat, Long, January average, February average ... December average

Rather than "reinventing the wheel," can anyone recommend a favorite module, package, or technique that would provide a reasonable interpolation of weekly values from monthly values? Linear would be fine, but it would be nice if we could use the coordinates to improve the interpolation based on nearby stations.

I've tagged this post with python because it's the language I've been using recently (although not its statistical functions). If the answer is "use a stats program like r" so be it, but I'm curious as to what's out there for python. Thanks!

like image 844
Martin Burch Avatar asked Jul 23 '12 23:07

Martin Burch


3 Answers

I haven't had a chance to dig into it, but the hpgl (High Performance Geostatistics Library) provides a number of kriging (geospatial interpolation) methods:

Algorithms

  • Simple Kriging (SK)
  • Ordinary Kriging (OK)
  • Indicator Kriging (IK)
  • Local Varying Mean Kriging (LVM Kriging)
  • Simple CoKriging (Markov Models 1 & 2)
  • Sequential Indicator Simulation (SIS)
  • Corellogram Local Varying Mean SIS (CLVM SIS)
  • Local Varying Mean SIS (LVM SIS)
  • Sequential Gaussian Simulation (SGS)
like image 66
monkut Avatar answered Sep 21 '22 20:09

monkut


If you are interested into expanding your experience into R, there are a number of good, well used and documented packages out there. I would start by looking at the Spatial Taskview, which lists what packages can be used for spatial data. One of the paragraphs deals with interpolation. I am most familiar with automap/gstat (I wrote automap), where especially gstat is a powerfull geostatistics package which supports a wide range of methods.

http://cran.r-project.org/web/views/Spatial.html

Integrating Python and R can be done in multiple ways, e.g. Using system calls or an in memory link using Rpy. See also:

Python interface for R Programming Language

like image 44
Paul Hiemstra Avatar answered Sep 23 '22 20:09

Paul Hiemstra


I am looking into doing the same thing, and I found this kriging module written by Sat Kumar Tomer at AMBHAS.

There appears to be methods for producing variograms and performing ordinary kriging.

I'll update this answer if I use this and make further discoveries.

like image 39
ryanjdillon Avatar answered Sep 22 '22 20:09

ryanjdillon