Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • Nov 28 20:30
    din14970 edited #2781
  • Nov 28 20:29
    codecov[bot] commented #2781
  • Nov 28 20:29
    din14970 synchronize #2781
  • Nov 28 20:17
    codecov[bot] commented #2703
  • Nov 28 20:17
    magnunor synchronize #2703
Mingquan Xu
@Mingquan_Xu_twitter
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()
adriente
@adriente

Hello,

I am using VSCode as an IDE. I use the jupyter plugin that enables jupyter notebooks to be used in the interface of VSCode. Everything was working well until recently. Now when I have a cell with :

import hyperspy.api as hs

The kernel dies. It is working well with import hyperspy though. Is that a known issue ? Is anybody else using VSCode and the hyperspy api ?

Thomas Aarholt
@thomasaarholt
Interesting! I can give it a shot later this weekend. Any idea how recently it was working?
18 replies
Abohaitham92
@Abohaitham92
Hello all, I have a question regarding loading an .edm file and then saving it to hdf5 file, i just loaded an edm file using s = hs.load(edm_file), which gave me a list of signals, what is the best way to save all of these signals into one hdf5 file ? I used to save one signal using s.save(test.hdf5). But now using the save command for each signal in my list on the same file will overwrite the file.
1 reply
lnaglecocco
@lnaglecocco
image.png
Hi, I think someone explained this to me before but I don't remember the explanation and can't find it - sorry. When I plot a model with plot_components=True, some of the components have features which shouldn't be part of the component. For example the red peak here is a GaussianHF yet it has features around 800 eV which contribute to the overall fit. What is that all about?
2 replies
lnaglecocco
@lnaglecocco
Another unrelated question, and thank you in advance. I have a dataset for which fitting a model can be quite time-consuming. So rather than re-fitting every time I load it up and want to look at it, I'd like to save it and simply load the file. However - when I try code like ".model.save("model",extension="hspy")", and then "model_2 = hs.load("model.hspy")", model_2 doesn't seem to have the model, just the experimental data. How can I save a model?
2 replies
DENSmerijn
@DENSmerijn
Hi all, we are trying to load a Velox .mrc file but we keep getting the following error: ValueError: cannot convert float NaN to integer
We have tried multiple files, all with the same outcome. Any idea what could be causing this issue?
7 replies
Mingquan Xu
@Mingquan_Xu_twitter
image.png
If I want to fit a fractional energy-range in my spectrum, how can I use the m.fit() function?
Like only fit the energy range marked in orange above
2 replies
Mingquan Xu
@Mingquan_Xu_twitter
image.png
3 replies
Hi, all, if I want to get the data-points of my model-fitting, the green line, how to do it? Because I want use those data-points to plot it individually.