-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to load JEOL's .map file #115
Comments
It seems that this file is not supported, can you please share a file that we can use to reproduce and test? |
Thank you for the response. |
Is the size of image fixed with 256x256 pixels? |
This test file contains 32 bytes header: And also 256x256 pixels double precision float values (8bytes / pixel). |
We need more sample data to resolve this issue. |
@PereraUmesha, would you be able to provide the information asked by @nem1234? Thanks! |
Describe the bug
I am trying to load a .map file from JEOL's EPMA (Electron Probe Micro Analyzer).
Then I get the below error.
WARNING:hyperspy.io_plugins.jeol:Not a valid JEOL img format
ERROR:hyperspy.io:If this file format is supported, please report this error to the HyperSpy developers.
UnboundLocalError Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 mdata = hs.load(map_fname)
File ~\anaconda3\envs\new202302\lib\site-packages\hyperspy\io.py:466, in load(filenames, signal_type, stack, stack_axis, new_axis_name, lazy, convert_units, escape_square_brackets, stack_metadata, load_original_metadata, show_progressbar, **kwds)
463 objects.append(signal)
464 else:
465 # No stack, so simply we load all signals in all files separately
--> 466 objects = [load_single_file(filename, lazy=lazy, **kwds)
467 for filename in filenames]
469 if len(objects) == 1:
470 objects = objects[0]
File ~\anaconda3\envs\new202302\lib\site-packages\hyperspy\io.py:466, in (.0)
463 objects.append(signal)
464 else:
465 # No stack, so simply we load all signals in all files separately
--> 466 objects = [load_single_file(filename, lazy=lazy, **kwds)
467 for filename in filenames]
469 if len(objects) == 1:
470 objects = objects[0]
File ~\anaconda3\envs\new202302\lib\site-packages\hyperspy\io.py:525, in load_single_file(filename, **kwds)
518 raise ValueError(
519 "
reader
should be one of None, str, "520 "or a custom file reader object"
521 )
523 try:
524 # Try and load the file
--> 525 return load_with_reader(filename=filename, reader=reader, **kwds)
527 except BaseException:
528 _logger.error(
529 "If this file format is supported, please "
530 "report this error to the HyperSpy developers."
531 )
File ~\anaconda3\envs\new202302\lib\site-packages\hyperspy\io.py:545, in load_with_reader(filename, reader, signal_type, convert_units, load_original_metadata, **kwds)
543 """Load a supported file with a given reader."""
544 lazy = kwds.get('lazy', False)
--> 545 file_data_list = reader.file_reader(filename, **kwds)
546 signal_list = []
548 for signal_dict in file_data_list:
File ~\anaconda3\envs\new202302\lib\site-packages\hyperspy\io_plugins\jeol.py:109, in file_reader(filename, **kwds)
107 fd.close()
108 else:
--> 109 d = extension_to_reader_mapping[file_ext](filename, **kwds)
110 if isinstance(d, list):
111 dictionary.extend(d)
File ~\anaconda3\envs\new202302\lib\site-packages\hyperspy\io_plugins\jeol.py:194, in _read_img(filename, scale, **kwargs)
190 _logger.warning("Not a valid JEOL img format")
192 fd.close()
--> 194 return dictionary
UnboundLocalError: local variable 'dictionary' referenced before assignment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Load the contents of .map file
Python environement:
Additional context
The text was updated successfully, but these errors were encountered: