Skip to main content

library to handle SPM and ToF-SIMS data

Project description

Downloads Build License Python 2.7 Python 3.6 DOI

pySPM

pySPM is a python library (python3, but should be compatible with python2) in order to read, handle and plot Scanning Probe Microscopy (SPM) images as well as ToF-SIMS data.

For now it support the following formats:

  • Nanoscan .xml file format
  • Bruker
  • Iontof ToF-SIMS fileformats:
    • ITA
    • ITM
    • ITS
  • Nanonis SXM file

Important

This library is offered as it is and is still in development. Please note that reading the raw data was done by reverse engineering and guessing and not with a manual as the file format is proprietary. It seems to work well with the data used by the developer of this library, but there is NO GUARANTY that this library will work correctly with your own specific data.

If you find bugs and issues, please report them to the developer: https://github.com/scholi/pySPM/issues

News

ITA files are writable

From now on you can, not only view the ita files, but you can also write them. For the moment this is still a non-user-friendly procedure, but you can edit each ITStr Block with the edit_block() function. Be careful, because if the new data has a different size than the old one, a new block is created, but the old one is also kept. This means that your ITA file size will grow. You can also add new channels and images with the more user-friendly function pySPM.ITA.add_new_images(). :warning: It is highly advised to copy the ita file before making any change. You can use the following code to copy the ita in a temporary ita before making any change.

from shutil import copyfile
import pySPM
copyfile(filename, "temp.ita")
A = pySPM.ITA("temp.ita")

New tools

The library comes with three scripts to make your life easier. Those scripts are located in your python folder in the Scripts directory. You can also run them from the command line.

stability

Allows you to select a measurement folder and display the Emission Current and Suppressor voltage in function of the time/scan number. This allows you to verify the stability of your source during your measurements. stability_screenshot

see the wiki for more info

plotter

Allows you to plot the parameter logged by your logfile. If SurfaceLab is running this script will detect which logfile is beeing saved and will display the values live (the plot is refreshed every 3s in order add the new data). You can also provide as first argument the logfile path (or in windows you can drag&drop the logfile over the plotter app). plotter_screenshot

see the wiki for more info

timer

If you are using SurfaceLab, this app will display a small progressbar of your measurement and will calculate the remaining time in function of the elapsed time, the total number of scans and the elapsed number of scan. timer_screenshot

see the wiki for more info

spectra

This tool can display spectra, visualize rapidly peaks assignment and perform fast mass calibration. You can give an ITA filename as argument or if none a GUI filedialog will ask you for one. You will then see your spectrum. You can navigate with the scroll of the mouse to zoom in & out. You can use the keyboard + and - to shift your spectra by ±1 Dalton. You can use left-mouse-button and drag to shift your spectra. You can perform very quick mass calibration by Right-Mouse-Click on one measurement peak (hold the mouse) the move to the element mark you want to assign your peak and release the mouse. The mass calibration values should then be updated on the left table and the mass calibration performed live so that you can see immediately the changes. spectra_screenshot

see the wiki for more info

pySPM is now availabe on pypi

The installation for end-user is now very easy. If you have pip, then you can install the library in a single line:

pip install pySPM

and to upgrade an old version:

pip install -U pySPM

Toy dataset

As the data are big and not necessary for the library another package pySPM_data was created with several AFM and ToF-SIMS data. You can install it with pip

pip install pySPM_data-0.2.4-py3-none-any.whl

or update it with

pip install -U pySPM_data-0.2.4-py3-none-any.whl

Structure reformatting

A setup.py is present in order to install the package easily. => in order to use the library do pip install -e .

Nice Spectra Plotting

import pySPM

filename = "..."
TOF = pySPM.ITA(filename)
TOF.showSpectrumAround(pySPM.utils.get_mass('C2H3NO'), pretty=True, formula=True)

Spectra

Python 2.7 compatible

The library is now compatible with Python 3 and Python 2.7

Dependencies

This library requires the following packages

  • mendatory
    • numpy
    • scipy
    • matplotlib
  • for PCA
    • scikit-learn
    • pandas
  • for GUI
    • pyQT5
  • displaying progressbar (while passing the prog=True parameter to functions)
    • tqdm

Installation

for regular users

With pip (easiest)

Just open a terminal (on Windows hit key [WINDOWS]+R, then type cmd, then [ENTER])

pip install pySPM

By manual installing

Download the library (zip) or git file. Unzip it and run

python setup.py install

For developers and hackers

If you wish to adjust the library to your need, the best is to install it in editable mode as follow from the root pySPM directory:

pip install -e .

Documentation

The documentation is still in its early stage read the documentation

There is also a short introduction to pySPM for ToF-SIMS data

Citing

If you use this library for your work, please think about citing it. DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pySPM-0.2.18.tar.gz (113.9 kB view details)

Uploaded Source

Built Distribution

pySPM-0.2.18-py2.py3-none-any.whl (270.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pySPM-0.2.18.tar.gz.

File metadata

  • Download URL: pySPM-0.2.18.tar.gz
  • Upload date:
  • Size: 113.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.7.2 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.1

File hashes

Hashes for pySPM-0.2.18.tar.gz
Algorithm Hash digest
SHA256 2cf2c84d6768c896db8f281fbe9497357cd84f109fea21d4672d8234b6cc32bd
MD5 7e0053e6b7cf8d128344feb70144b230
BLAKE2b-256 224e89b308a9daadc9d224533b8072e4a1a441686faaf306591baf647bdbe95f

See more details on using hashes here.

File details

Details for the file pySPM-0.2.18-py2.py3-none-any.whl.

File metadata

  • Download URL: pySPM-0.2.18-py2.py3-none-any.whl
  • Upload date:
  • Size: 270.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.7.2 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.1

File hashes

Hashes for pySPM-0.2.18-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d283dc1dfc1dea6819343ef6a9bfa6b47aa98c9f77a6475741964c9c20e90a11
MD5 6c426230d28d4409f346119ddd3b2291
BLAKE2b-256 58f086f6d4b4624571650ec8bfd4502865f519258999d53d3d9def0f5e3873e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page