Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:06
    jheinen opened #2860
  • Nov 30 08:25
    jlaehne commented #110
  • Nov 30 08:17
    jlaehne labeled #994
  • Nov 30 08:14
    jlaehne commented #1718
  • Nov 30 08:14
    jlaehne commented #1066
  • Nov 28 21:05
    codecov[bot] commented #2703
  • Nov 28 21:04
    codecov[bot] commented #2703
  • Nov 28 20:54
    magnunor commented #2703
  • Nov 28 20:54
    magnunor commented #2703
  • Nov 28 20:51
    codecov[bot] commented #2703
  • Nov 28 20:51
    magnunor synchronize #2703
  • Nov 28 20:42
    codecov[bot] commented #2781
  • Nov 28 20:31
    codecov[bot] commented #2703
  • Nov 28 20:31
    codecov[bot] commented #2703
  • Nov 28 20:30
    din14970 edited #2781
  • Nov 28 20:30
    din14970 edited #2781
  • Nov 28 20:30
    din14970 edited #2781
  • Nov 28 20:30
    din14970 edited #2781
  • Nov 28 20:30
    din14970 edited #2781
  • Nov 28 20:30
    din14970 edited #2781
OliDG
@OliDG

Hello,

The [example code for interactive line2DROI] (hyperspy/hyperspy#2414) triggers the following valueerror for me: "The value is out of the axis limits".
Can anyone reproduce the error or it it just me? (Hyperspy is vesion 1.6.2, hyperspygui 1.4.0.)

here is the code:

#https://github.com/hyperspy/hyperspy/pull/2414
import hyperspy.api as hs

im0 = hs.datasets.example_signals.reference_hologram()
im1 = hs.datasets.example_signals.object_hologram()

im0.plot()
im1.plot()

line_profile = hs.roi.Line2DROI(400, 250, 220, 600, 2)
line0 = line_profile.interactive(im0)
line1 = line_profile.interactive(im1)

hs.plot.plot_spectra([line0, line1])

the same happens with the [exemple from the docs] (https://hyperspy.org/hyperspy-doc/current/user_guide/interactive_operations_ROIs.html)

import hyperspy.api as hs
holo = hs.datasets.example_signals.object_hologram()
roi = hs.roi.Line2DROI(x1=465.577, y1=445.15, x2=169.4, y2=387.731, linewidth=0)
holo.plot()
ss = roi.interactive(holo)

Thanks!
Olivier

3 replies
Zanetta Pierre-marie
@ZanettaPM

Hi folks !
Did anyone already mentioned that if you pass the limit of 10 X rays lines and if you try to extract their intensities to save them into the metadata to be able to save the entire signal under an .hspy format, hyperspy sort them in a weird sequence ?

import numpy as np
import hyperspy.api as hs
s=hs.datasets.example_signals.EDS_TEM_Spectrum()
s.metadata
s.add_elements(['O','Ca','O','Ti','Al','Si','Mg','C','Cu','Ga','Fe','V','Cr'])
s.add_lines()
s.metadata.Sample.intensities=s.get_lines_intensity()
s.metadata

I try to use the sort function and other tricks but I have difficulty to make the list match my list of Xray lines and kfactors for the quantification. Any ideas? should I open an issue ? It might be more convenient if the list match the Xray line order. Thanks !

4 replies
Zanetta Pierre-marie
@ZanettaPM
Capture.PNG
lnaglecocco
@lnaglecocco

Hi, I've encountered a strange issue with EELS data analysis. I have a LowLoss data file and a HighLoss data file. I can save them as Hyperspy objects and plot them, and the data is clearly all there, although for the LowLoss the zero loss peak is not at 0 eV. However when I try to align it, using the below code, I find that both the LowLoss and HighLoss datasets are somehow cut down to only exist over a very narrow range, as if they are somehow getting cropped in signal space. This only happens with some datasets, and other datasets work as they should with no issue. Does anyone know the problem here? I am able to share example data files if it would be useful for debugging

LowLoss.align_zero_loss_peak(calibrate=True,also_align=[HighLoss],subpixel=True)

6 replies
Mingquan Xu
@Mingquan_Xu_twitter
Hi, all, I have a question about the PCA algorithm. In my understanding, the PCA (or SVD) has an averaging effect when applied in our data containing tiny features. When I try to use PCA to de-noise my atomic-resolution EELS, the averaging effect is obvious. In my EELS map of ~30 atoms, only one atom has its unique feature, while after PCA, the unique feature disappears and its spectrum became similar to the sum spectrum from other atoms. Is there any other de-noise algorithm to avoid this effect?
Thomas Aarholt
@thomasaarholt
Well, with PCA, how many components are you using? Are you inspecting the loadings/factors before removing them?
7 replies
PCA only works well if you have multiple measurements of a given feature. If your unique atom is resolved only by a single pixel, PCA can't help, because it uses similar information that is present in the other pixels to help reduce the noise.
I can recommend performing curve fitting to capture the feature in question. Can you give us a screenshot of the spectrum?
Mingquan Xu
@Mingquan_Xu_twitter
one atom has 4x4 pxiels.
Mingquan Xu
@Mingquan_Xu_twitter
I use "specifying vline=True" to estimate the number of significant components in PCA scree plot, and it usually tells me 6~10 compoments for reconstruction.
Tan-Shengdong
@Tan-Shengdong
Hi, all. I have a question about EDS quantification using Hyperspy. Now I would like to get the intensity of Pt La peak (9.44KeV), but there are also Au signal (9.7KeV) in my result, although it is weak. I would like to know how to get the exact intensity of Pt peak? (My data is not eds mapping form, and it is a msa. file)
3 replies
Mingquan Xu
@Mingquan_Xu_twitter
image.png
8 replies
Hi, when I tried to do model_fit, it usually does not easily converge and I need to run the cell for several time.
Is there any way to make the convergence in a single running for the model-fitting.
Thomas Aarholt
@thomasaarholt
You can pass maxiter=10000 as a kwarg to m.fit(), I think. But in general it implies that your model is bad for the data. Do you have a screenshot of m.plot()? (maybe also m.plot(True)?
Weixin Song
@winston-song
Hi All, when I run ll_ex.isig[3.:].spikes_removal_tool(), there is an error' AttributeError: 'super' object has no attribute 'next'. anyone saw this error before? whether this is due to package update?
thanks
Tan-Shengdong
@Tan-Shengdong
Hi all, I found that after I used curve fitting function and get the peak intensity, some intensity are minus. What causes this? In this case, could we still trust the intensity of which near the 'minus peak'?
10 replies
pquinn-dls
@pquinn-dls
@Tan-Shengdong - when you remove a background from a signal (and there is very little signal) the variation or noise in the data may result in negative data points depending on the removal. If you look across a sample and you find negative and positive points then you can statistically check the results - e.g. if the mean is zero then you're not really measuring anything, just noise and you can use some statistics analysis to determine what is actual signal. If you try to enforce that the counts are always positive after a background is removed then when you integrate the data for a given element you'll always have some +ive number or a +ive bias. So negative values aren't bad - you just need to think about the errors/statistics when look at low concentrations
Mingquan Xu
@Mingquan_Xu_twitter
image.png
Hi, @thomasaarholt , this is the 'm.plot()' result.
Tan-Shengdong
@Tan-Shengdong

image.png

Hi Mingquan, when I use the m.plot, it will only show the whole curve with out the specific peak

Thomas Aarholt
@thomasaarholt
@Mingquan_Xu_twitter is showing the result of m.plot(True), where the True first argument is to show the individual components as well as the total fit.
OliDG
@OliDG

@ericpre Hi Eric,
I try to display the hs.roi.Line2DROI(x,y,x,y,w) directly on the figure plotted with hs.plot.plot_images(my_EDS_maps) to further get the composition profile. So far I have to replot each individual maps, stack the line profiles in a list and plot them with plot_spectra(Line_profile_list).

Here is the figure details,

plt1 = hs.plot.plot_images(my_EDS_maps)

Out[54]: 
[<AxesSubplot:title={'center':'Cd'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>,
 <AxesSubplot:title={'center':'Cu'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>,
 <AxesSubplot:title={'center':'Ga'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>,
 <AxesSubplot:title={'center':'Mo'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>,
 <AxesSubplot:title={'center':'Rb'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>,
 <AxesSubplot:title={'center':'S'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>,
 <AxesSubplot:title={'center':'Se'}, xlabel='width axis (µm)', ylabel='height axis (µm)'>]

But then I am stuck, finding no ways to add the line ROI on them. What could I do ?

ROI = line_roi.interactive(plt1[0])
[...]
AttributeError: 'AxesSubplot' object has no attribute 'axes_manager'

Best,

3 replies
Ruben Bjørge
@rbjorge

Hi all, I have a question about saving large datasets. Is there any way of "saving lazily"? If, for example, I don't have at least 128 GiB of memory the following will run out of memory and crash:

import hyperspy.api as hs
import dask.array as da
data = da.random.random((512, 512, 256, 256))
s = hs.signals.Signal2D(data).as_lazy()
s.save('save_test.hspy')

I see that using Zarr will probably solve this (hyperspy/hyperspy#2825), but I actually want to save the data as a Blockfile. Is that possible?

8 replies
Hugh Ramsden
@0Hughman0

I need to make use of non-uniform-axes functionality, I notice there used to be a branch for this, but this has since been incorporated into NEXT_MINOR_RELEASE, which I guess isn't stable as it's still being worked on. I'm wondering what's best for me to do here? How long will it be before NEXT_MINOR_RELEASE?

I'm actually a LumiSpy user, but their recommendation is to install this non-uniform-axes branch which no longer exists 🤔.

In any case, thanks for the great library, incredibly useful for me.

Thomas Aarholt
@thomasaarholt
Hehehe, you can just install the current next_minor_release branch
How are you normally installing things in python?
Hugh Ramsden
@0Hughman0
pip
Is next_minor_release stable enough for me to get going with?
Thomas Aarholt
@thomasaarholt
image.png
Yep
pip install https://github.com/hyperspy/hyperspy/archive/refs/heads/RELEASE_next_minor.zip
That contains the merged non-uniform functionality
Hugh Ramsden
@0Hughman0
I am reassured by the word RELEASE in that url 😜
Thomas Aarholt
@thomasaarholt
Hehehe :p
Hugh Ramsden
@0Hughman0
ty
Mingquan Xu
@Mingquan_Xu_twitter
Hi, all, how can I map out Signal (Dynamic) in HyperSpy: when I change the energy-loss region in SI, the mapping change simultaneously.
I guess I need the interactive(), but do not find such a example in the online-documentation page.
Could you give me a hint for this?
Mingquan Xu
@Mingquan_Xu_twitter
image.png
I have used the above method to do this, but not sure whether there is a better way?
Tan-Shengdong
@Tan-Shengdong
微信截图_20211018101225.png
微信截图_20211018101214.png
Hi all, when I used Hyperspy to deal with EDS data, I noted that there is some shift of the same peak (such as Pt_La) among different data.
I have used add_elements(), add_line() and calibrate_xray_lines()
Thomas Aarholt
@thomasaarholt
@Tan-Shengdong is there a question there? :)
@Mingquan_Xu_twitter Could you explain a bit further what you want? "map out Signal (Dynamic)" wasn't very clear.
Tan-Shengdong
@Tan-Shengdong
@thomasaarholt I just want to ask why there is a shift? I think the x-ray position of each element should be a constant.
Thomas Aarholt
@thomasaarholt
Oh, I see. I'm not sure of the physical reason either, but I've definitely heard of shifts before - it's why the calibration functions exist.
Zanetta Pierre-marie
@ZanettaPM
@Tan-Shengdong I think that is because you use calibrate_xray_lines() it tunes the parameter of the Gaussian and among them the center position. I you just wants to change the energy resolution use calibrate_energy_resolution()