Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:42
    codecov[bot] commented #3070
  • 08:39
    codecov[bot] commented #3070
  • 08:26
    codecov[bot] commented #3070
  • 08:26
    nem1234 synchronize #3070
  • Dec 06 18:13
    ericpre transferred #3071
  • Dec 06 18:12
    ericpre commented #3073
  • Dec 06 18:12

    dependabot[bot] on github_actions

    (compare)

  • Dec 06 18:11

    ericpre on RELEASE_next_minor

    Bump softprops/action-gh-releas… Merge pull request #3072 from h… (compare)

  • Dec 06 18:11
    ericpre closed #3072
  • Dec 06 13:01
    PVacek commented #3071
  • Dec 05 14:48
    codecov[bot] commented #3073
  • Dec 05 14:40
    codecov[bot] commented #3073
  • Dec 05 14:33
    djeedjay synchronize #3073
  • Dec 05 14:24
    djeedjay opened #3073
  • Dec 05 09:25
    codecov[bot] commented #3072
  • Dec 05 09:08

    dependabot[bot] on github_actions

    Bump softprops/action-gh-releas… (compare)

  • Dec 05 09:08
    dependabot[bot] labeled #3072
  • Dec 05 09:08
    dependabot[bot] opened #3072
  • Dec 05 02:39
    nem1234 edited #3070
  • Dec 03 15:58
    nem1234 commented #3070
Jonas Lähnemann
@jlaehne
Well, the background region is not initiated with any values, so the start and end values do not exist. In the traitsui (qt) window it shows nans, in the ipywidgets inline display it just shows an empty field.
For me an alternative way to make it work is to use %matplotlib widget together with the hyperspy-gui-ipywidgets package. The plot is then displayed inline and I can also add the background region by clicking and dragging on the spectrum window.
Minimum working example:
%matplotlib widget
import hyperspy.api as hs
import numpy as np
s = hs.signals.Signal1D(np.arange(1024))
s.remove_background()
UrsulaLu
@UrsulaLu
image.png
It is really weird, tried it, I get also now the inline GUI window, but still no chance for get
ting the shaded box
UrsulaLu
@UrsulaLu
image.png
image.png
Restarted Kernel and now throws the error. The ipywidgets are installed.
UrsulaLu
@UrsulaLu
@jlaehne After installing ipympl 0.7.0 the background subtraction now finally works. Thanks!
Naren
@narendraraj
we can use python based script the collect 4DSTEM data series with EDX data. We save in h5 format not able to structure it properly include metadata and make it supportable for hyperspy. Please someone guide me how to write out data on hdf5 formate that can support hypersy or /and py4dstem or/and pyxem. If there is information already on how write data please share the link.
7 replies
MurilooMoreira
@MurilooMoreira
Hello guys, I searched a lot in the github and here in the gitter for solutions about how to open jeol eds data and I saw people are trying to do that since few years, but I don't know if someone figured out how to do it in hyperspy. Is it possible? I am with data from jeol eds (.pts, .map, .img, .asw) and I am with difficulties to open it. Someone could help me please?
MurilooMoreira
@MurilooMoreira
I found here that the function to open this type of data is already implemented and it works hyperspy/hyperspy#2488
7 replies
But I don't know how to access the tool to use in my jupyter notebook for example.
wstolp
@wstolp
Hi, rebinning a ComplexSignal2D gave me an error, so I made a small change to the source code, which seems to work. It now rebins the real and imaginary parts seperately.
Anything I need to know before I send a pull request? The developer guide gives me a 404 :(
also I'm very new with github
Thomas Aarholt
@thomasaarholt
Hi @wstolp! Taking a look now about the dev guide!
I can't reproduce the 404 - where did you find it?
I went to https://hyperspy.org/ and pressed "Documentation" under both Stable and Development (on the right hand side)
And then look under "Developer Guide"
We're very happy to help new developers like yourself, so just have a go and we'll help with what you need :)
wstolp
@wstolp
Hi Thomas. Yes later I saw there are multiple developer guide type pages. The 404 I saw here https://github.com/hyperspy/hyperspy, scroll down to "contributing guidelines", then "developer guide".
purewendy
@purewendy
Hello, I would like to do EELS fitting on my data. The hs.preferences.gui() links to GOS directory to C:\Program Files\Gatan. This is the directory of my installed Digital Micrograph. But it's show show errors. Any idea to fix it? Thanks very much!
Weixin Song
@winston-song
Hi All, I use hs.plot.plot_images(atom_percent, scalebar =[0],scalebar_color='white'), is there any way to customize the scalebar length and the fontsize of the scalebar?
Weixin Song
@winston-song

Hi All, I use hs.plot.plot_images(atom_percent, scalebar =[0],scalebar_color='white'), is there any way to customize the scalebar length and the fontsize of the scalebar?

atom_percent is a list

Thomas Aarholt
@thomasaarholt
@purewendy what is your error?
Jędrzej Morzy
@JMorzy
Hi, I have a ragged (yeah, I know :/) data array (1 spectral dimension, 2 'navigation' dimensions that are actually scan number and time). I'd like to do some PCA on it. At the moment, the empty spots in the ragged array are filled with NaNs. Is there any way of making it work despite the NaNs? I was thinking it should be possible to reshape the array into a 1D array (flattening the scan and scan number away) and then re-reshaping it back and looking at the loadings afterwards, but that sounds like a total botch. Any more elegant ideas?
Sorry, 2D. One very long navigation dimension and one normal signal dimension of course
Thomas Aarholt
@thomasaarholt
Hi @JMorzy, which part of your data is ragged? Are you missing entries in the signal or navigation dimension?
I normally think of ragged arrays as ala:
[
    [1,2,3],
    [1,2,3,4],
]
How does this compare with your data?
Jędrzej Morzy
@JMorzy
Exactly, ragged in the navigation dimension. The scans are different lenghts (scan number is my y, time is my x)
Then to make it non-ragged to put it into numpy array/hs signal I filled the gaps with NaNs
2 replies
Corentin Le Guillou
@CorentinLG
Hi all, I am using the non_uniform_axes brnach. Since last update (apparently), the m.set_signal_range() function does not accept explicit axis values, but only axis indices. Ant idea why ? And a suggestion to go around that problem ? thanks
3 replies
Mingquan Xu
@Mingquan_Xu_twitter
Hi, all, is there any packages that can do local low rank denoising for EEL spectrum image?
Thomas Aarholt
@thomasaarholt
What is low rank denoising? I use PCA and ICA a lot for eels in hyperspy.
I see. I hadn't heard about it before.
Mingquan Xu
@Mingquan_Xu_twitter
Hi, @thomasaarholt , yes, I also know this from this article, but do not know which software can do this process.
I have tried PCA and NMF in hyperspy on my data (SI), the results are not so good.
Thomas Aarholt
@thomasaarholt
Havd you thought about what might be causing your data's results to be "not so good"? What sort of eels is it?
rtangpy
@rtangpy
Hi all, I am doing model fitting, with 2D navigation and 1D signal. I have two questions: 1. since I need to fit more than 1 million pixels, using multifit will take me 50 mins. Is there any method that can speed up the code; 2. before I learned how to use hyperspy, I use multiprocessing with 8 cores to perform optimize.minimize to speed up code. Interestingly, using hyperspy multifit which only uses one core is even slighly faster than my code with multiprocessing (8 cores). I am curious about how hyperspy can reach such high speed.
13 replies
adriente
@adriente

I am performing data analysis on EDXS data. For the analysis I need some parameters such as sample thickness, elements in the sample, etc .. Depending on the microscope that was used (and the corresponding acquisition software) these parameters are not all filled in the metadata.

Is there a way to set the metadata parameters so that the previous values are not overwritten and only the empty ones are filled ?
I know it is possible to do that for elements using s.add_elements(["Si"]), but I couldn't find the same function for microscope parameters for example.

2 replies
Eric Prestat
@ericpre
image.png
2 replies
@adriente, is it not what you need?
Zezhong Zhang
@zezhong-zhang
samfire_red_chis.png

Hi everyone, I am trying use SamFire for EELS model fitting, After reading the documentation and the source code a bit, I still have few question about how to set up properly. I currently have the setup as:

# to fit 5% of the pixels to estimate the starting values
shape = (s_eels.axes_manager.navigation_axes[1].size, s_eels.axes_manager.navigation_axes[0].size)
mask = np.random.choice([0, 1], size=shape, p=[0.05, 0.95])
m.multifit(mask=mask, optimizer='lm', bounded=True,iterpath='serpentine',kind='smart')
# then start samfire
samf = m.create_samfire(workers=2, ipyparallel=False) *#create samfire*
samf.metadata.goodness_test.tolerance = 0.3 *#set a sensible tolerance*
samf.refresh_database() # here is to refresh the stragtegy or the pixel fitted? it reads bit contradictory from the documentation and the source code
samf.start(optimizer='lm', loss_function='ls', bounded=True,iterpath='serpentine',kind='smart', optional_components=['Mn_L3','O_K','PowerLaw']) *#start fitting*

The fitting results have following issues:

  1. Only the already m.multfit() fitted pixels have sensible values, the others does not have a good fit. I also tried fitting some pixels with smart_fit() which gives similar results. This can be verified with m.red_chisq.plot() (see attached).

  2. The vacuum pixels yiled growth for the powerlaw fitting of the pre-edge range, due to the noise, and the edge components fail as well as there should be none. Thus, I have all the components as optional but this is not the solution. Is it possible to switch off the fitting for the vacuum, I guess one can use mask.

  3. One quesiton about the elemental component intensity for mapping, I saw discussion in #2562, is it possible to have the absolute intensity or show the H-S cross-section under the given microscope condition? As I want to know their exact product to calculate the partial cross-section…

  4. One final question about the fine structure coefficient when m.enable_fine_structure(), are those a combination of gaussians? Can we acess the gaussian height, width and centre? I currently counldn’t find docs about the values in the fine_structure_coefficient, but see sometimes their values are negative and the plot indeed shows negetive gaussian correspondingly to fit the curve (which occurs even after forcing all edge component to be possitive), does the negative values make sense? If it is gaussian combination, it will be really helpful to have the acess to their values (instead of making gaussian models oneself), which can be used for computing white line for example.

I am happy to give a minimum example if that could be helpful. Many thanks for your helps!

Thomas Aarholt
@thomasaarholt
@zezhong-zhang I'm happy you're using SAMFIRE! I too am unsure on how exactly to set it up. It will be good to get a working example.
I really like your approach for creating a mask, using random.choice!
  1. The vacuum pixels should indeed be masked in the way you describe. I'm not sure how masking works with samfire!
  1. I suggest you add a comment to that post, and perhaps delve into the source code and see if you can help shed light.