underchemist / nanonispy Goto Github PK
View Code? Open in Web Editor NEWA small library written in python 3 to parse Nanonis binary and ascii files
License: MIT License
A small library written in python 3 to parse Nanonis binary and ascii files
License: MIT License
Thanks a lot for this module.
Are there any plans for a Python 3.6 support?
Hi,
I've got a guy trying to install nanonispy from a git clone/ running install, and it throws the following error:
$python setup.py install
running install
running bdist_egg
running egg_info
creating nanonispy.egg-info
writing nanonispy.egg-info\PKG-INFO
writing dependency_links to nanonispy.egg-info\dependency_links.txt
writing requirements to nanonispy.egg-info\requires.txt
writing top-level names to nanonispy.egg-info\top_level.txt
writing manifest file 'nanonispy.egg-info\SOURCES.txt'
error: package directory 'nanonispy\tests' does not exist
I've been scratching my head looking at the setup.py
file but can't offer you any further insight into why its hanging.
Cheers,
Jack
Hi,
I managed to take some data with duplicitous header entries (lol nanonis).
So the nap.read.Spec chokes on line 405, because the data footprint of the header is longer than the length of the parsed header, e.g., the return of _parse_dat_header (which doesn't duplicate the entries apparently).
If I replace 405 with:
f = open(self.fname, 'r')
ff = f.readlines()
header_lines = ff.index('[DATA]\n') + 2
f.close()
It appears to get the right value for header_lines
.
For example
from pathlib import Path
import nanonispy as nap
path_to_datafile = Path('/path/to/datafile.3ds')
grid = nap.read.Grid(path_to_datafile)
will fail with a TypeError
TypeError: 'PosixPath' object is not subscriptable
The reason is, well the a PosixPath object is not subscriptable like this
if fname[-3:] != ext:
I will open a pull request to fix that.
//anaconda/lib/python3.5/site-packages/nanonispy/read.py in start_byte(self)
112 for line in f:
113 # Convert from bytes to str
--> 114 print(line)
115 entry = line.strip().decode()
116 if tag in entry:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xec in position 10: invalid continuation byte
Hi,
I encounter this ~semi-regularly, but can't reliably reproduce it unfortunately. Sometimes adding an 'ignore' in the decode() works, sometimes not.
np.int, np.float, etc have been deprecated in newer versions of numpy. There is an open pull request to rectify this
from david.wander at web dot de
Dear Yann-Sebastien,
first of all, I would like to thank you for sharing your nanonispy library.
It makes the data treatment of my measurements much easier!However, I just found a major bug in the _load_data function of the Grid class.
Line 230 of read.py (nanonispy Version 1.0.7) reads:griddata_shaped = griddata.reshape((nx, ny, exp_size_per_pix))
Here you are confusing x and y. The correct code would be:
griddata_shaped = griddata.reshape((ny, nx, exp_size_per_pix))
Of course this then implies that after loading the data, you first have to address y and then x, so for example like this:
grid.signals['params'][index_y][index_x][param_index]
I admit that it is easy to miss this error because it seems to give the right array shapes but if you take a close look, you will realize that when going from
signals['params'][0][0] to signals['params'][1][0] (i.e. increasing the x index by 1), it is actually the y coordinate that changes (signals['params'][1][0][3])
For square shaped grids, this might not be a desaster, as it only leads to a grid rotated by 90° but as soon as you work with other shapes, things get totally messy.I hope you will correct this in the next version of the package!
Best regards,
David Wander
Currently, the header
information for comment
of .sxm
-files do not support entries with more than one line; only the first line is taken and the rest is cut off.
This is because the header
-entries are split
with \n
as the delimiter.
EDIT: Saw PR #13 that addresses the multipass entries.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.