This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Python is a great language to use for automatic processing of scientific data. Scanning probe microscopes (SPM) produce scientific data in the form of images, images of surfaces that can have atomic or molecular resolutions. The microscope produces surfaces that are not level. Before you can analyse the surface, the surface must first be levelled (flattened). This Python library provides routines to flatten the surface and to generate statistical data on surface structures. Surfaces with contaminations, step edges and atomic or molecular resolution can be handled.

SPIEPy and SPIW - MATLAB Toolbox [source] are related projects. SPIEPy uses many algorithms originally designed by the SPIW project. The performance of these algorithms is discussed in REVIEW OF SCIENTIFIC INSTRUMENTS 84, 113701 (2013) [DOI].

The library SPIEPy has the packages spiepy with the modules for the tasks described above and spiepy.demo to generate sample data. With this sample data, you can familiarize yourself with SPIEPy.

Dependencies

SPIEPy requires the NumPy library (http://www.numpy.org), SciPy library (http://scipy.org) and the Matplotlib library (http://matplotlib.org). You must install them manually.

Installation

Using pip:

> pip install SPIEPy

CLASSES

Im
SPIEPy_image_structure, set attribute data with a 2D ndarray of image data, set all other attributes with the metadata of the image.

FUNCTIONS

Flattening functions:

  • flatten_by_iterate_mask
  • flatten_by_peaks
  • flatten_poly_xy
  • flatten_xy

Locating functions:

  • locate_masked_points_and_remove
  • locate_regions
  • locate_steps
  • locate_troughs_and_peaks

Masking functions:

  • mask_by_mean
  • mask_by_troughs_and_peaks
  • mask_tidy

Measuring functions:

  • measure_feature_properties

Demo functions:

  • list_demo_files
  • load_demo_file

DATA

NANOMAP
Colormap which is the standard orange colormap used my most SPM software.

Help

On the interpreter console use the built-in help function to get the help page of the module, function, …

>>> import spiepy, spiepy.demo
>>> help(spiepy)
...
>>> help(spiepy.demo)
...
>>> help(spiepy.flatten_by_iterate_mask)
...

Documentation: http://pythonhosted.org/SPIEPy/

Example usage

# -*- coding: utf-8 -*-
#
#   Copyright © 2014 Stephan Zevenhuizen
#   Flattening terrace image, (02-12-2014).
#

import spiepy, spiepy.demo
import matplotlib.pyplot as plt
import numpy as np

im = spiepy.Im()
demos = spiepy.demo.list_demo_files()
print demos
im.data = spiepy.demo.load_demo_file(demos[1])

plt.imshow(im.data, cmap = spiepy.NANOMAP, origin = 'lower')
print 'Original image.'
plt.show()

im_out, _ = spiepy.flatten_xy(im)
plt.imshow(im_out.data, cmap = spiepy.NANOMAP, origin = 'lower')
print 'Preflattened image.'
plt.show()

mask = spiepy.locate_steps(im_out, 4)
plot_image = np.ma.array(im_out.data, mask = mask)
palette = spiepy.NANOMAP
palette.set_bad('#00ff00', 1.0)
plt.imshow(plot_image, cmap = palette, origin = 'lower')
print 'Preflattened image, mask.'
plt.show()

im_final, _ = spiepy.flatten_xy(im, mask)
plt.imshow(im_final.data, cmap = spiepy.NANOMAP, origin = 'lower')
print 'Flattened image.'
plt.show()

y, x = np.histogram(im_out.data, bins = 200)
ys, xs = np.histogram(im_final.data, bins = 200)
fig, ax = plt.subplots()
ax.plot(x[:-1], y, '-b', label = 'Standard plane flattening')
ax.plot(xs[:-1], ys, '-r', label = 'SPIEPy stepped plane flattening')
ax.legend(loc = 2, fancybox = True, framealpha = 0.2)
ax.set_xlabel('z (nm)')
ax.set_ylabel('count')
plt.show()

Authors & affiliations

Stephan J. M. Zevenhuizen [1]

[1]Condensed Matter and Interfaces, Debye Institute for Nanomaterials Science, Utrecht University, Utrecht, The Netherlands.
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SPIEPy-0.1.2.zip (4.4 MB) Copy SHA256 Checksum SHA256 Source Dec 20, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting