Reading/writing block files

41 views
Skip to first unread message

Ankush Kashiwar

unread,
Aug 6, 2018, 11:12:15 AM8/6/18
to hyperspy-users
Dear All

I am trying to extract individual images (diffraction signals) from scanning precession electron diffraction block file using following commands: 

hyperspy.io_plugins.blockfile.file_reader(filenameendianess='<'mmap_mode=Nonelazy=False**kwds)
hyperspy.io_plugins.blockfile.file_writer(filenamesignal**kwds)
However, I have not been able to execute these commands, I am getting an error message:

AttributeError: module 'hyperspy' has no attribute 'io_plugins'


Nevertheless, 'io_plugins' package  with the script 'blockfile.py' is stored under following address: 

anaconda3/lib/python3.6/site-packages/hyperspy


Could you please suggest a potential solution to this problem?


Thank you.


Best Regards

Ankush Kashiwar

Josh Taillon

unread,
Aug 6, 2018, 11:59:44 AM8/6/18
to hypersp...@googlegroups.com
Hi Ankush,

This sounds like a problem either with your installation, or how you're trying to access the file.

We typically recommend using hyperspy through the api, by running the statement

import hyperspy.api as hs

Then you would load the file using:

hs.load('filename.ext')

It should automatically detect the filetype from the extension and use the right reader. If you are trying to use hyperspy more low-level as a library, you would have to import the correct module directly:

from hyperspy.io_plugins import blockfile
blockfile.file_reader('filename.ext')

Hopefully that helps.

- Josh
--
You received this message because you are subscribed to the Google Groups "hyperspy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hyperspy-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Joshua Taillon
Reply all
Reply to author
Forward
0 new messages