# Spatial data¶

This notebook focus on representation of spatial EMI survey using EMagPy Python API.

First let’s start with an example where spatial EMI data were collected on a ~30 cm thick soil over a clay-rich regolith.

# import modules
import os
import sys
sys.path.insert(0,'../src/')
testdir = '../src/examples/saprolite/'
from emagpy import Problem

# import data
k = Problem()
k.createSurvey(testdir + 'mexpl.csv')

k.show()

# the X and Y coordinates of the survey are already in British Grid (EPSG:27700)
k.showMap()

k.showMap(coil=k.coils[2], contour=True, pts=True) # contouring of third coil


Now one can use the different interpolation method to get a map. Let’s compare them below.

k = Problem()
k.createSurvey(testdir + 'regolith.csv')
k.convertFromNMEA()
k.gridData(method='nearest')
k.showMap()

k = Problem()
k.createSurvey(testdir + 'regolith.csv')
k.convertFromNMEA()
k.showMap()

k = Problem() # create an emagpy instance
k.createSurvey(testdir + 'regolith.csv')
k.convertFromNMEA()
k.gridData(method='cubic')
k.showMap()

k = Problem() # create an emagpy instance
k.createSurvey(testdir + 'regolith.csv')
k.convertFromNMEA()
k.gridData(method='idw')
k.showMap()


## Observations¶

Cubic interpolation seems to perform the best and IDW has this problem of small mountains around the points. This might be solved by changing the exponent of the inverpolation in the function of IDW. Note that we haven’t compare it to kriging yet.

Download python script: nb_regolith.py

Download Jupyter notebook: nb_regolith.ipynb

View the notebook in the Jupyter nbviewer

Run this example interactively: