hyperspy.api.samfire.local_strategies
#
A SAMFire strategy that operates in "pixel space" - i.e calculates the starting point estimates based on the local averages of the pixels. |
|
|
Reduced chi-squared Local strategy of the SAMFire. |
- class hyperspy.api.samfire.local_strategies.LocalStrategy(name)#
Bases:
SamfireStrategy
A SAMFire strategy that operates in “pixel space” - i.e calculates the starting point estimates based on the local averages of the pixels. Requires some weighting method (e.g. reduced chi-squared).
- clean()#
Purges the currently saved values.
- plot(fig=None)#
Plots the current marker in a flat image
- Parameters:
- fig
hyperspy.api.signals.Signal2D
ornumpy.ndarray
if an already plotted image, then updates. Otherwise creates a new one.
- fig
- Returns:
hyperspy.api.signals.Signal2D
The resulting 2D signal. If passed again, will be updated (computationally cheaper operation).
- property radii#
A tuple of >=0 floats that show the “radii of relevance”
- refresh(overwrite, given_pixels=None)#
Refreshes the marker - recalculates with the current values from scratch.
- Parameters:
- overwritebool
If True, all but the given_pixels will be recalculated. Used when part of already calculated results has to be refreshed. If False, only use pixels with marker == -scale (by default -1) to propagate to pixels with marker >= 0. This allows “ignoring” pixels with marker < -scale (e.g. -2).
- given_pixels
numpy.ndarray
of bool Pixels with True value are assumed as correctly calculated.
- remove()#
Removes this strategy from its SAMFire
- property samf#
The SAMFire that owns this strategy.
- update(ind, isgood)#
Updates the database and marker with the given pixel results
- values(ind)#
Returns the current starting value estimates for the given pixel. Calculated as the weighted local average. Only returns components that are active, and parameters that are free.
- property weight#
A Weight object, able to assign significance weights to separate pixels or maps, given the model.
- class hyperspy.api.samfire.local_strategies.ReducedChiSquaredStrategy#
Bases:
LocalStrategy
Reduced chi-squared Local strategy of the SAMFire. Uses reduced chi-squared as the weight, and exponential decay as the decay function.
- clean()#
Purges the currently saved values.
- plot(fig=None)#
Plots the current marker in a flat image
- Parameters:
- fig
hyperspy.api.signals.Signal2D
ornumpy.ndarray
if an already plotted image, then updates. Otherwise creates a new one.
- fig
- Returns:
hyperspy.api.signals.Signal2D
The resulting 2D signal. If passed again, will be updated (computationally cheaper operation).
- property radii#
A tuple of >=0 floats that show the “radii of relevance”
- refresh(overwrite, given_pixels=None)#
Refreshes the marker - recalculates with the current values from scratch.
- Parameters:
- overwritebool
If True, all but the given_pixels will be recalculated. Used when part of already calculated results has to be refreshed. If False, only use pixels with marker == -scale (by default -1) to propagate to pixels with marker >= 0. This allows “ignoring” pixels with marker < -scale (e.g. -2).
- given_pixels
numpy.ndarray
of bool Pixels with True value are assumed as correctly calculated.
- remove()#
Removes this strategy from its SAMFire
- property samf#
The SAMFire that owns this strategy.
- update(ind, isgood)#
Updates the database and marker with the given pixel results
- values(ind)#
Returns the current starting value estimates for the given pixel. Calculated as the weighted local average. Only returns components that are active, and parameters that are free.
- property weight#
A Weight object, able to assign significance weights to separate pixels or maps, given the model.