Skip to content

Overview#

PyQuickMaps is a slim python library to link (seafloor) maps and sampling data with prediction methods. Needs scipy, numpy, matplotlib, pykrige, osgeo, rasterio.

Example#

import pyquickmaps.pqm as pqm

# Download example grid
import urllib
urllib.request.urlretrieve("https://download.pangaea.de/dataset/930063/files/MSM96_WA1_PAP_100m.tif", "MSM96_WA1_PAP_100m.tif")

# Load grid
dataset = pqm.loadGridAsGDALDataset("MSM96_WA1_PAP_100m.tif")

# Load observations (lat,lon,val pairs where the values in this case show porosity from seafloor sediment samples)
obs = pqm.Observations([[47.9612,-14.6399,0.7905],[47.9350,-14.6742,0.8012],[47.8985,-14.8153,0.8041],[48.0553,-14.5886,0.8054],[48.0540,-14.5740,0.8053],[48.0888,-14.6881,0.8248],[47.9988,-14.6615,0.8140],[47.8584,-14.5118,0.8195],[47.8098,-14.7317,0.8056]])

# Compute grids
results = {}
results['Interpolation'] = pqm.interpolateObservationsToGrid(obs,500,500)
results['Kriging'] = pqm.krigeObservationsToGrid(obs,500,500)
results['Random Forest'] = pqm.predictObservationsToGrid(obs,dataset)

# Plot computed grids and overlay with observations
fig, axs = pqm.visualizeResults(results,obs,figsize=30)

# Write results to disk
pqm.writeResults("/some/path/","test",results)

Contact#

Timm Schoening - tschoening@geomar.de