-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add plot_linescan utility #55
base: main
Are you sure you want to change the base?
Conversation
An alternative would be to add support for non uniform axis to the |
I agree. Unless we wanted to add other functionalities to such plots (e.g. markers which follow peaks), I would take @ericpre approach. |
Hyperspy |
Adding the parameters the |
These should be easy to fixed, the |
OK, if you prefer to extend |
@ericpre Did you mean to add these functions in the hyperspy package or here? I agree with you that the hyperspy PS:
|
I can have a look to improve I have kept them separate not to overload a single function, but it is true that a stack/list of single spectra or a linescan do have some things in common and it might not be bad to improve this 'super' function. Apart from that, we could still decide to have this as a convenience function in LumiSpy. This function is what I have been developing over the years and in itself is quite mature for linescans. Only thing that would need to be added at the moment are the tests. |
You will be surprise how much functionalities you can pack in a function! ;) For example: import hyperspy.api as hs
s = hs.datasets.artificial_data.get_core_loss_eels_line_scan_signal()
for style in ['overlap', 'cascade', 'mosaic', 'heatmap']:
hs.plot.plot_spectra(s, style=style) and this example which I particularly like for its simplicity! Generally, I find it confusing when several functions/method do very similar kind of things... because it is not clear which functions should be used, the difference, etc... For example, in the last few days, I had to do some interpolation and I find it confusing that there are many functions in scipy.interpolate. Obviously, most of them are different but for some of them, it is difficult to know what are they differences by reading the documentation! |
Any updates on this? What I am trying to say here @ericpre and @jlaehne is that lumispy could have luminescence-specific plotting utilities (in |
I never got around looking at the HyperSpy functions in detail and how to implement the functionality there. Indeed, we should discuss whether we might not have a few specific extra functions here. So far I simply still use my offline version of that function, from which this PR was forked. It does make sense to give HyperSpy functions some extra functionality, but when they get more complicated also the barrier to use them for specific types of plots gets more difficult. Thinking about it, I do still see an extra benefit of a dedicated linescan plotting function with a very dedicated set of options. If we should agree on that, I would go over the PR again as some of the arguments could probably be named more close to |
I would go ahead. But let's wait for @ericpre opinion on having some lumispy-specific plotting utils |
As far as I understand, the functionalities discussed here are useful for most spectroscopy technique and I don't see what is luminescence specific! |
Well, for e.g. an EDX linescan, you would normally not plot the full spectra against position (might look fun though). For other signal types used in HyperSpy and not included in LumiSpy it may indeed be useful as well. We simply use linescans quite a lot and this is why such a tool can be handy - in contrast to |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
============================================
- Coverage 100.00% 88.26% -11.74%
============================================
Files 12 13 +1
Lines 556 622 +66
============================================
- Hits 556 549 -7
- Misses 0 73 +73 ☔ View full report in Codecov by Sentry. |
Description of the change
Add a function to plot spectral linescans as colormap based on my stock function. Using pcolormesh, it can handle non-uniform axes.
Progress of the PR
Minimal example of the bug fix or the new feature