coreglib module

Library of functions that can be used for horizontal co-registration of raster data

These were written in 2012-2013, and should be cleaned up and tested before use

The ASP pc_align ICP co-registration is usually superior to these approaches

demcoreg.coreglib.bin_by(x, y, nbins=360)[source]
demcoreg.coreglib.compute_offset_ncc(dem1, dem2, pad=(9, 9), plot=False)[source]

Compute horizontal offset between input rasters using normalized cross-correlation (NCC) method

demcoreg.coreglib.compute_offset_nuth(dh, slope, aspect)[source]

Compute horizontal offset between input rasters using Nuth and Kaab [2011] (nuth) method

demcoreg.coreglib.compute_offset_sad(dem1, dem2, pad=(9, 9), plot=False)[source]

Compute horizontal offset between input rasters using sum of absolute differences (SAD) method

demcoreg.coreglib.find_first_peak(corr)[source]

Find row and column indices of the first correlation peak.

Parameters:corr (np.ndarray) – the correlation map
Returns:
  • i (int) – the row index of the correlation peak
  • j (int) – the column index of the correlation peak
  • corr_max1 (int) – the value of the correlation peak
  • Original code from openPIV pyprocess
demcoreg.coreglib.find_subpixel_peak_position(corr, subpixel_method='gaussian')[source]

Find subpixel approximation of the correlation peak.

This function returns a subpixels approximation of the correlation peak by using one of the several methods available. If requested, the function also returns the signal to noise ratio level evaluated from the correlation map.

Parameters:
  • corr (np.ndarray) – the correlation map.
  • subpixel_method (string) – one of the following methods to estimate subpixel location of the peak: ‘centroid’ [replaces default if correlation map is negative], ‘gaussian’ [default if correlation map is positive], ‘parabolic’.
Returns:

  • subp_peak_position (two elements tuple) – the fractional row and column indices for the sub-pixel approximation of the correlation peak.
  • Original code from openPIV pyprocess

demcoreg.coreglib.func(x, a, b, c)[source]
demcoreg.coreglib.genplot(x, y, fit)[source]