hyperspy / hyperspy

Multidimensional data analysis
https://hyperspy.org
GNU General Public License v3.0
508 stars 208 forks source link

s.remove_elements() does not exist for EELS or EDS #1337

Open thomasaarholt opened 7 years ago

thomasaarholt commented 7 years ago

EELS and EDS signals do not have a method to remove added elements (which are added by s.add_elements()), which makes it inconvenient if one has accidentally added the wrong element to a signal. s.metadata.Sample.elements = [] does not work, nor does s.elements.clear().

francisco-dlp commented 7 years ago

Implementing this should be as simple as sharing the current functionality implemented for EDS with the EELS class.

thomasaarholt commented 7 years ago

I couldnt find it for eds. are you sure it exists?

On Mon, 28 Nov 2016 at 10:54, Francisco de la Peña notifications@github.com wrote:

Implementing this should be as simple as sharing the current functionality implemented for EDS with the EELS class.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hyperspy/hyperspy/issues/1337#issuecomment-263228668, or mute the thread https://github.com/notifications/unsubscribe-auth/ACmGj0PfpGRPYiP_5MRowxR7hLohSRmrks5rCqTxgaJpZM4K6sEp .

francisco-dlp commented 7 years ago

You are right, they don't exist in EDS either, what exists is set_elements which is a combination of erasing all elements and adding new ones. However, in EDS, unlike in EELS, you could simply do s.metadata.Sample.elements.remove("Fe") to remove an element, while for EELS this doesn't work. In any case, my comment was misleading, it is actually not that straightforward to implement this feature, but it shouldn't be very hard either.