Mustafa Uçar
Mustafa Uçar

Reputation: 432

How to apply kriging for 3D arrays in Python?

I have a 3D numpy array with some elevation values. I would like to apply kriging interpolation method to them and get a full valued array with same given shape.

My purpose is to create a surface actually. The values, I have, are hydrogelogical layers. Every layer from top to bottom are described with grid and I have some height values as described below. Nevertheless, I need height values for every grid.

For instance there is an array I have. "0" marks unknown values, others values are given values. 3 layer, 10 rows, 15 columns:

[[[ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0  9  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [11  9 11 11 10  9 11 11 11 11  9 11  11 11 9]
  [ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0  8  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 13  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]]

[[[ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0  9  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [11  9 11 11 10  9 11 11 11 11  9 11  11 11 9]
  [ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0  8  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 13  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]]

[[[ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0  9  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [11  9 11 11 10  9 11 11 11 11  9 11  11 11 9]
  [ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 10  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0  8  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 13  0  0  0  0  0  0  0  0  0  0  0]
  [ 0  0  0 12  0  0  0  0  0  0  0  0  0  0  0]]

I want to apply kriging to get interpolated values based on given values.

Upvotes: 3

Views: 1004

Answers (1)

Jean A.
Jean A.

Reputation: 301

You can definitely do it using Kriging algorithm. I showed an example in 2D here using OpenTURNS platform. It can be easily adapted in 3D.

Upvotes: 0

Related Questions