hyperspy / exspy

EDS and EELS data analysis with HyperSpy
https://hyperspy.org/exspy
GNU General Public License v3.0
10 stars 10 forks source link

signal_type "EDS" not understood #19

Open jlaehne opened 8 months ago

jlaehne commented 8 months ago

Loading an MSA file (from EDAX), the signal type is set to EDS, which is not a known signal type as only EDS_SEM and EDS_TEM are available. The MSA files do not contain any information on the type of instrument, but as far as I remember some other readers decide on the basis of the acceleration voltage (>30 kV = TEM, otherwise SEM), which signal_type to use.

Easiest might be to implement the correct signal_type setting in the rsciio reader? Alternatively, we could could try to implement the decision on the exspy side, because it should affect various types of file formats and does not make too much sense to repetitively have that code in different rsciio readers.

Here is the error message:

>>> s2 = hs.load("InGaN_nanowires_spectra.MSA")
WARNING | Hyperspy | `signal_type='EDS'` not understood. See `hs.print_known_signal_types()` for a list of installed signal types or https://github.com/hyperspy/hyperspy-extensions-list for the list of all hyperspy extensions providing signals. (hyperspy.io:707)
ericpre commented 8 months ago

Adding a workaround setting signal_type in rosettasciio would be the easiest by adding a shared function (based on the bruker approach) that parse the metadata in the relevant readers.

There are situation where setting the signal_type will be incorrect, because assigning the correct signal class will never be always correct, even the instrument type is known (SEM versus TEM): you can have a thin specimen in a SEM and a thick specimen in a TEM! For the few corner cases, where it doesn't play, the user should set the suitable signal_type manually. Basically, there is not way to get it always right.

xref https://github.com/hyperspy/rosettasciio/issues/37