-
Notifications
You must be signed in to change notification settings - Fork 5
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 notebook showing how to make elemental maps using EELS #3
Conversation
Also minor restructuring of datasets for this tutorial.
…ents Update elemental mapping EELS tutorial to HyperSpy 1.5
…demos into idahj-EELSmap_tutorial
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
EELS/EELS_elemental_mapping.ipynb
Outdated
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is notebook to show how to quantify elemental maps, wouldn't it be better to keep it focused on the analysis part and simply use the convenience function hs.plot.plot_images
to display the maps and move the part on how to use matplotlib to make a figure of maps to a separate notebook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a section on how to show the results using m.components.Zn_L3.intensity.plot()
and hs.plot.plot_images
.
I think having the more advanced plotting, via matplotlib, is also useful. As people often want to create high quality figures from the data they've processed, and having it directly in the same notebook makes it easier to do this.
But it can of course be moved to a separate notebook, ideally in the same exspy-demos/EELS/
folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is important to split them in separate notebook:
- the elemental mapping notebook will be more clear and more focused (less clutter due to the plotting code). One advantage of using hyperspy/exspy is remove a lot of the python code in workflows and the tutorial should reflect this.
- The notebook on customising matplotlib figure will get more visibility on its own rather than included in EELS elemental mapping notebook. Also since this can be used for EDS maps in a very similar fashion, it should go in somewhere else than the EELS folder so that user interested in EDS can also find this notebook easily.
- At the end of the day, users will copy and paste code to make their own notebook, so it doesn't need to be in the same notebook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points! I moved the matplotlib plotting part to its own notebook.
I created a new folder plotting_and_visualization
, but not sure if that is the best name.
In addition, should the model.hspy
file be added as well? For example in EELS/datasets/
? This so people don't have to run through the whole EELS elemental map notebook before they can run the plotting notebook. It is 1.3 MB.
EELS/EELS_elemental_mapping.ipynb
Outdated
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"cb_zn = fig.colorbar(ax_zn.images[0], cax=cbar_zn, extend='both', orientation='horizontal', label=\"Relative Zn, [a.u.]\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these arbitrary units?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess "non-calibrated" is the more correct term, as we don't know the beam current well enough to get quantitative information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the elemental maps, the beam current is not necessary, because the cross section should be sensitivity factor, similarly to Cliff-Lorimer for EDS - there are similar to the Hartree Slater cross section in GMS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm, what would be a better term than Relative Zn, [a.u.]
?
Many good points! I started fixing things, but still a couple things remaining. |
I resolved all the comments (and tag them as resolved), except the two remaining ones which require some discussion. |
Done! I moved the matplotlib plotting to its own notebook. Note that the files are currently lacking there, I was not sure if/where the |
I made a PR to simplify the notebooks: magnunor#1 |
Very nice! I merged those changes. I wasn't sure if in I also added a cell showing how to use ``hs.plot.plot_roi_map`, as (I feel) this feature is very useful for this type of data. |
EELS/EELS_elemental_mapping.ipynb
Outdated
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Before running the full fitting routine, we do a quick, interactive, exploration of the data using `hs.plot.plot_roi_map`. Move and resize the red and blue spans by click-and-dragging with your mouse. The red span should be from about 930 to 1005 eV, and the green from 1045 to 1145 eV." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note to mention these maps contain the background and that their interpretation needs to take that into account?
If you show these maps here it would be good to discuss the comparison with/without background subtraction. Just on its own and in its current form, it is not clear what does it shows and what the purpose of this step in this notebook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I added both the visualization without the background removal, and with the background removal.
Especially the latter shows really nice why we have to use more advanced data processing to separate the intensity of Cu from the Zn. Ergo, why we have to use the model based approach.
Maybe adding the |
I don't think that it makes cluttered but it does feel a bit out of place - it is not clear why you would this step here and what is its outcome. |
I kept the part with |
Originally from the pull request hyperspy/hyperspy-demos#39
This pull request makes it work with HyperSpy 2.0.0