Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
I realized that for a map the new centroid function, similar to e.g.
valuemax
andindexmax
in HyperSpy returns aBaseSignal
with 2 navigation dimensions and 0D signal, which theoretically makes sense, but is inconvenient for plotting as it plots including the navigator, which makes little sense for 0D signals, and colormap cannot be changed.In contrast,
estimate_peak_width
returns the transposed signal, thusSignal2D
object without navigation dimensions, which is more convenient for plotting - and is okay in the sense that it is just an image of values for the different positions. Theas_signal
command for parameters from a fit also results inSignal2D
. I therefore think, it is the more sensible output here.We should consider making that more consistent also in HyperSpy (e.g. with the 2.0 release).
As I was at it, I also removed optional parameters from the title if they are not set.
Progress of the PR
Minimal example of the bug fix or the new feature
now results in