scarplet.core module¶
Functions for determining best-fit template parameters by convolution with a grid
-
scarplet.core.
calculate_amplitude
(dem, Template, scale, age, angle)[source]¶ Calculate amplitude and SNR of features using a template
Parameters: - dem : DEMGrid
Grid object of elevation data
- Template : WindowedTemplate
Class representing template function
- scale : float
Scale of template function in DEM cell units
- age : float
Age parameter for template function
- angle : float
Orientation of template in radians
Returns: - amp : np.array
2-D array of amplitudes for each DEM pixel
- snr : np.array
2-D array of signal-to-noise ratios for each DEM pixel
-
scarplet.core.
calculate_best_fit_parameters
(dem, Template, scale, age, ang_max=<MagicMock name='mock.__truediv__()' id='139642881308376'>, ang_min=<MagicMock name='mock.__neg__().__truediv__()' id='139642866901960'>, **kwargs)[source]¶ Calculate best-fitting parameters using a template with parallel search
Parameters: - dem : DEMGrid
Grid object of elevation data
- Template : WindowedTemplate
Class representing template function
- scale : float
Scale of template function in DEM cell units
- age : float
Age parameter for template function
Returns: - results : np.array
Array of best amplitudes, ages, orientations, and signal-to-noise ratios for each DEM pixel. Dimensions of (4, height, width).
Other Parameters: - ang_max : float, optional
Maximum orietnation of template, default pi / 2
- ang_min : float, optional
Minimum orietnation of template, default -pi / 2
-
scarplet.core.
calculate_best_fit_parameters_serial
(dem, Template, scale, ang_max=<MagicMock name='mock.__truediv__()' id='139642871070056'>, ang_min=<MagicMock name='mock.__neg__().__truediv__()' id='139642881446744'>, **kwargs)[source]¶ Calculate best-fitting parameters using a template
Parameters: - dem : DEMGrid
Grid object of elevation data
- Template : WindowedTemplate
Class representing template function
- scale : float
Scale of template function in DEM cell units
Returns: - best_amp : np.array
2-D array of best-fitting amplitudes for each DEM pixel
- best_age : np.array
2-D array of best-fitting agees for each DEM pixel
- best_angle : np.array
2-D array of best-fitting orientations for each DEM pixel
- best_snr : np.array
2-D array of maximum signal-to-noise ratios for each DEM pixel
Other Parameters: - ang_max : float, optional
Maximum orietnation of template, default pi / 2
- ang_min : float, optional
Minimum orietnation of template, default -pi / 2
- kwargs : optional
Any additional keyword arguments that may be passed to the template() method of the Template class
-
scarplet.core.
compare
(results, ny, nx)[source]¶ Compare template matching results from asynchronous tasks
Parameters: - results : iterable
Iterable containing outputs of a template matching method
- ny : int
Number of rows in output
- nx : int
Number of columns in output
Returns: - best_amp : np.array
2-D array of best-fitting amplitudes
- best_age : np.array
2-D array of best-fitting morphologic ages
- best_angle : np.array
2-D array of best-fitting orientations
- best_snr : np.array
2-D array of maximum signal-to-noise ratios
-
scarplet.core.
load
(filename)[source]¶ Load DEM from file
Parameters: - filename : string
Filename of DEM
Returns: - data_obj : DEMGrid
DEMGrid object with DEM data
-
scarplet.core.
match
(data, Template, **kwargs)[source]¶ Match template to input data from DEM
Parameters: - data : DEMGrid
DEMGrid object containing input data
- Template : WindowedTemplate
Class of template function to use
Returns: - results : np.array
Array of best amplitudes, ages, orientations, and signal-to-noise ratios for each DEM pixel. Dimensions of (4, height, width).
-
scarplet.core.
match_template
(data, Template, scale, age, angle, **kwargs)[source]¶ Match template function to curvature using convolution
Parameters: - data : DEMGrid
Grid object of elevation data
- Template : WindowedTemplate
Class representing template function
- scale : float
Scale of template function in DEM cell units
- age : float
Age parameter for template function
- angle : float
Orientation of template in radians
Returns: - amp : np.array
2-D array of amplitudes for each DEM pixel
- age : np.array
template age in m2
- angle : np.array
template orientation in radians
- snr : np.array
2-D array of signal-to-noise ratios for each DEM pixel
Other Parameters: - kwargs : optional
Any additional keyword arguments that may be passed to the template() method of the Template class
References
Modifies method described in
Hilley, G.E., DeLong, S., Prentice, C., Blisniuk, K. and Arrowsmith, J.R., 2010. Morphologic dating of fault scarps using airborne laser swath mapping (ALSM) data. Geophysical Research Letters, 37(4). https://dx.doi.org/10.1029/2009GL042044