Skip to content
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

Importing nanoscope 9.4 files fails #204

Open
flounderscore opened this issue Apr 8, 2019 · 5 comments
Open

Importing nanoscope 9.4 files fails #204

flounderscore opened this issue Apr 8, 2019 · 5 comments

Comments

@flounderscore
Copy link

I cannot import a file created with NanoScope 9.4. The error message is:

File "...translators\bruker_afm.py", line 321, in _read_image_layer
data_mat = data_vec.reshape(layer_info['Number of lines'], layer_info['Samps/line'])
ValueError: cannot reshape array of size 524288 into shape (512,512)

The issue appears to be a bug in the NanoScope software >= 9.2 where all data is 4 bytes per pixel even though the header says otherwise.

See line 391 in https://sourceforge.net/p/gwyddion/code/HEAD/tree/trunk/gwyddion/modules/file/nanoscope.c#l31

@ramav87
Copy link
Contributor

ramav87 commented Apr 8, 2019

We could probably add a flag to check for this. Is the version of the Nanoscape used to create the file stored?

@ssomnath
Copy link
Member

Pycroscopy will benefit if Gwyddion is somehow integrated into it - file reading, filters, etc. I know that they have a python package / interface somewhere

@ramav87
Copy link
Contributor

ramav87 commented May 15, 2019

I have made a temporary fix which is available on my branch. Please let me know if it works for you.

@ziatdinovmax
Copy link
Contributor

Pycroscopy will benefit if Gwyddion is somehow integrated into it - file reading, filters, etc. I know that they have a python package / interface somewhere

https://github.com/tuxu/gwyfile

@JayBee38
Copy link

I've been confronted to the same reshape issue, the fix worked for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants