Comments (11)
hi scholi, I have checked, it is working now. thanks a lot for your help!
from pyspm.
So this looks like an issue with the parser.
The reverse engineering in the parser is done on a best effort basis, as these are proprietary file formats, causing bugs like these.
If you send me the bruker file I can take a look and try and debug what's happening - [email protected]
from pyspm.
So your data are not an image but are one dimensional? Get_channel was meant to work with images....
Here your rows is not a single value but is a double 0 which is hard for me to interprete.... I imagine that this means 2- one dimensional data. so your voltametric hysterisis.
As suggested by dineshpinto I think the best is to get such a file for better support.
from pyspm.
Hi everyone,
Input2 channel also contains an image, I could open it Nanoscope (software from Bruker). As our Bruker does not have an integrated potentiostat, we use SP300 Biologic Potentiostat and connect it to Bruker via two extra channels (low freq. analog), named Input1 and Input2.
I have sent my .spm file to email of dineshpinto as suggested.
thanks a lot for your help.
from pyspm.
So I took a look at the file.
>>> p = Path("Data", "test.spm")
>>> scan = pySPM.Bruker(p)
>>> scan.list_channels()
Channels
========
S [ZSensor] "Height Sensor"
S [DeflectionError] "Deflection Error"
S [Lateral] "Friction"
S [Lateral] "Friction"
S [Input1] "Input1"
S [Input2] "Input2"
Extracting the data stored in layer 5 (i.e. Input 2), there is something quite wrong with the data here.
The offset, data length, samples per line are all 0.
>>> scan.layers[5]
{b'Data offset': [b'0'],
b'Data length': [b'0'],
b'Bytes/pixel': [b'2'],
b'Start context': [b'ECCON'],
b'Data type': [b'STM'],
b'Plane fit': [b'0 0 0 0'],
b'Frame direction': [b'Up'],
b'Capture start line': [b'0'],
b'Color Table Index': [b'12'],
b'Relative frame time': [b'15265.4'],
b'Invalid Data Flag': [b'None'],
b'Invalid Data Fill': [b'None'],
b'Samps/line': [b'0 0'],
b'Number of lines': [b'256'],
b'Aspect Ratio': [b'1:1'],
b'Scan Size': [b'2 2 ~m'],
b'Scan Line': [b'Main'],
b'Line Direction': [b'Trace'],
b'Highpass': [b'0'],
b'Lowpass': [b'0'],
b'Realtime Planefit': [b'None'],
b'Offline Planefit': [b'None'],
b'Valid data start X': [b'0'],
b'Valid data start Y': [b'0'],
b'Valid data len X': [b'256'],
b'Valid data len Y': [b'256'],
b'Tip x width correction factor': [b'1'],
b'Tip y width correction factor': [b'1'],
b'Tip x width correction factor sigma': [b'1'],
b'Tip y width correction factor sigma': [b'1'],
b'@2:Image Data': [b'S [Input2] "Input2"'],
b'@Z magnify': [b'C [2:Z scale] 0.0002848307'],
b'@2:Z scale': [b'V [Sens. Input2] (0.0003750000 V/LSB) 24.57600 V'],
b'@2:Z offset': [b'V [Sens. Input2] (0.0003750000 V/LSB) 0.004500000 V'],
b'Voltam current range': [b'0 26666.7 32767 32767 32767 32767 32767 32767 32767'],
b'Z magnify image': [b'1'],
b'Temporal volt range': [b'2'],
b'Voltam volt min': [b'-2666.67'],
b'Voltam volt max': [b'2666.67'],
b'Smoothing filter': [b'0'],
b'Scope coupling': [b'DC'],
b'Voltam function': [b'Current'],
b'Temporal current range': [b'0 26666.7 32767 32767 32767 32767 32767 32767 0'],
b'Temporal time range': [b'100'],
b'Temporal time start': [b'0'],
b'Temporal time end': [b'100'],
b'Temporal function': [b'Current']}
There is something wrong with this channel in the data file, you need to double check this.
For reference, I compared it to the output of layer 4 (i.e. Input 1) and you can see all those fields have values in them.
>>> scan.layers[4]
{b'Data offset': [b'1129536'],
b'Data length': [b'262144'],
b'Bytes/pixel': [b'2'],
b'Start context': [b'OL'],
b'Data type': [b'AFM'],
b'Plane fit': [b'0 0 0 5'],
b'Frame direction': [b'Up'],
b'Capture start line': [b'0'],
b'Color Table Index': [b'12'],
b'Relative frame time': [b'15265.4'],
b'Invalid Data Flag': [b'None'],
b'Invalid Data Fill': [b'None'],
b'Samps/line': [b'256'],
b'Number of lines': [b'256'],
b'Aspect Ratio': [b'1:1'],
b'Scan Size': [b'2 2 ~m'],
b'Scan Line': [b'Main'],
b'Line Direction': [b'Trace'],
b'Highpass': [b'0'],
b'Lowpass': [b'0'],
b'Realtime Planefit': [b'None'],
b'Offline Planefit': [b'None'],
b'Valid data start X': [b'0'],
b'Valid data start Y': [b'0'],
b'Valid data len X': [b'256'],
b'Valid data len Y': [b'256'],
b'Tip x width correction factor': [b'1'],
b'Tip y width correction factor': [b'1'],
b'Tip x width correction factor sigma': [b'1'],
b'Tip y width correction factor sigma': [b'1'],
b'@2:Image Data': [b'S [Input1] "Input1"'],
b'@Z magnify': [b'C [2:Z scale] 0.01505534'],
b'@2:Z scale': [b'V [Sens. Input1] (0.0003750000 V/LSB) 24.57600 V'],
b'@2:Z offset': [b'V [Sens. Input1] (0.0003750000 V/LSB) 0.1138125 V']}
from pyspm.
Could you send me the file?
from pyspm.
Email?
from pyspm.
Hi dineshpinto, I see you have closed the issue recently. Could you please share what was the result of this problem? Thank you
from pyspm.
So I have already shared my thoughts in #37 (comment), I am not convinced this is an issue with pySPM.
@scholi also has the file, maybe he can weigh in too?
from pyspm.
There is a bug in the library somehow. So Input2 has a proper Data Length and offset. The Input2 is followed by \*EC AFM plot V vs. T list
which is not understood by the library and the data of the AFM plot (so 1D data) overwrite the data ot Input2.
from pySPM import Bruker
import os
import numpy as np
import struct
import matplotlib.pyplot as plt
%matplotlib inline
A = Bruker(os.path.expanduser("~/Downloads/test.spm"))
A.get_channel("Input2").show()
I could correct it locally. I need to push the changes...
from pyspm.
OK I have pushed the data to github. Could you try it? (So don't use pip, but use the library from github)
from pyspm.
Related Issues (20)
- Issue with median of differences correction HOT 2
- "li" variable not defined in ITM.py HOT 6
- reuse file format reader in afmformats HOT 3
- Defining regions of interest (ROI) HOT 2
- Nonsquare scans Bruker files (.spm) HOT 5
- SurfaceLab7 .itax & .itm file support HOT 8
- lower case augment support for get_channel() struct.error: unpack requires a buffer of 369664 bytes HOT 1
- Error when opening an ITM File generated by Surface Lab 7 HOT 2
- Bruker spm format: request for explanantion of overall scale computation HOT 1
- Question: basic plotting code HOT 1
- Controlling image axix label size font type..etc HOT 1
- Unable to load an approach curve from Bruker Icon HOT 5
- Error while using correct_lines/ correct_slope on .spm- (Bruker-) data with different x-,y-dimension HOT 2
- Unable to read a SXM file from Nanonis HOT 11
- Bruker get_channel floating point parsing error HOT 6
- Need Engage X and Y Pos info HOT 2
- get_channel("Height") issue HOT 12
- show_summary can't find funit HOT 1
- Example files not available HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyspm.