geopyv.subset¶
Module Contents¶
Classes¶
Initialisation of geopyv subset object. |
|
Subset base class to be used as a mixin. Contains plot functionality. |
|
Subset results object for geopyv. |
- class geopyv.subset.Subset(*, f_coord=None, f_img=None, g_img=None, template=None)¶
Bases:
SubsetBaseInitialisation of geopyv subset object.
- Parameters:
coord (numpy.ndarray (x, y), optional) – Subset coordinates.
f_img (geopyv.image.Image, optional) – Reference image of geopyv.image.Image class, instantiated by
Image.g_img (geopyv.image.Image, optional) – Target image of geopyv.imageImage class, instantiated by
Image.template (geopyv.templates.Template, optional) – Subset template object, instantiated by
CircleorSquare.
- solved¶
Boolean to indicate if the subset has been solved.
- Type:
bool
- solve(*, max_norm=0.001, max_iterations=15, order=1, p_0=None, tolerance=0.7, method='ICGN')¶
Method to solve for the subset displacements using the various methods.
- Parameters:
max_norm (float, optional) – Exit criterion for norm of increment in warp function. Defaults to value of \(1 \cdot 10^{-3}\).
max_iterations (int, optional) – Exit criterion for number of Gauss-Newton iterations. Defaults to value of 50.
order (int) – Warp function order. Options are 1 and 2.
p_0 (ndarray, optional) – 1D array of warp function parameters with float type.
tolerance (float, optional) – Correlation coefficient tolerance. Defaults to a value of 0.7.
method (str) – Solution method. Options are FAGN and ICGN. Default is ICGN since it is faster.
- Returns:
solved – Boolean to indicate if the subset instance has been solved.
- Return type:
bool
Note
The warp function parameter array can be used to precondition the computation if passed non-zero values.
Otherwise, the initial guess at the subset displacement is performed by
_get_initial_guess().If not specified, the solver defaults to a first order warp function.
For guidance on how to use this class see the subset tutorial.
See also
_get_initial_guess_size()_get_initial_guess()
- class geopyv.subset.SubsetBase¶
Subset base class to be used as a mixin. Contains plot functionality.
- convergence(show=True, block=True, save=None)¶
Method to plot the rate of convergence for the subset using
convergence_subset.- Parameters:
show (bool, optional) – Control whether the plot is displayed.
block (bool, optional) – Control whether the plot blocks execution until closed.
save (str, optional) – Name to use to save plot. Uses default extension of .png.
- Returns:
fig (matplotlib.pyplot.figure) – Figure object.
ax (matplotlib.pyplot.axes) – Axes object.
Note
The figure and axes objects can be returned allowing standard matplotlib functionality to be used to augment the plot generated. See the plots tutorial for guidance.
Warning
Can only be used once the subset has been solved using the
solve()method.
See also
- inspect(show=True, block=True, save=None)¶
Method to show the subset and associated quality metrics using
inspect_subset.- Parameters:
show (bool, optional) – Control whether the plot is displayed.
block (bool, optional) – Control whether the plot blocks execution until closed.
save (str, optional) – Name to use to save plot. Uses default extension of .png.
- Returns:
fig (matplotlib.pyplot.figure) – Figure object.
ax (matplotlib.pyplot.axes) – Axes object.
Note
The figure and axes objects can be returned allowing standard matplotlib functionality to be used to augment the plot generated. See the plots tutorial for guidance.
See also
- class geopyv.subset.SubsetResults(data)¶
Bases:
SubsetBaseSubset results object for geopyv.
- Parameters:
data (dict) – geopyv data dict from Subset object.
- data¶
geopyv data dict from Subset object.
- Type:
dict
Note
Contains all of the plot functionality provied by
SubsetBasebut none of the algorithms provided bySubset(i.e. you can’t use this to re-analyse images). Purely used to store data and interrogate results.