Skip to main content

This package enables the exploration of datacube of spectra within a rich GUI interface.

Project description

Spimcube

N|Solid

spimcube provides a graphical user interface (GUI) coded with matplotlib to explore datacube of spectra, in other words, tridimensional set of data containing spectra.

Currently, the GUI is designed for datacubes obtained from a spatial mapping where a spectrum is recorded at each pixel of the map. But in futur releases, there will be tools to explore general datacube where each dimension can be: time, magnetic field, temperature, etc.

The package has three modules:

  • spimclass containing the main objects implemented in the package, i.e Spim and SpimInterface.
  • functions mostly functions used internally in the classes defined in spimclass.
  • procedures included for personal purposes.
Spim object

Object used to initialize the set of data. It has multiple initialization methods depending on the user raw data. It possesses methods allowing for diverse kind of map plot: the default one being "spectrally filtered spatial image" with the method intensity_map.

SpimInterface object

Object that implement the GUI. It is conceived in such a way that if the user identifies interesting data points or ROI within the GUI, he can easily switch to command line interface (CLI) to manipulate those. Actually, this GUI is thought as an exploration tool for datacube before going to more thorough analysis through classical CLI.

Installation and upgrade

To install spimcube simply type in your terminal:

$ pip install spimcube

To update to the last version of the package use:

$ pip install --upgrade spimcube

Example of use

Start by importing the tools:

$ from spimcube.spimclass import (Spim, SpimInterface)

Depending on the default backend on your system, you may need to use the magic command %matplotlib available through ipython (either on terminal or jupyter notebook). Just type:

$ %matplotlib

which will allows for interactive windows.

Then, you may proceed as follows (presented below is the simplest case of use of the tools, with no options):

# If you are on UNIX OS (MacOS, Linux, etc.):
path = "/my/path/to/my/folder/"
filename = "name_of_the_file"

# If you are on Windows OS:
path = "C:\\my\\path\\to\\my\\folder\\"   # Don't forget the double backslash, otherwise python interpret '\' as an escape character.
filename = "name_of_the_file"


spim = Spim(path, filename)
spim.initialization_textfile()

Here, note that there exist different "initialization" methods. You can check those by typing:

dir(Spim)

Alternatively, a coordinate file can be used, which will additionaly plot a grid of the scanned positions:

spim.define_space_range(coordinate_file="/my/path/filename.txt")

# Also, ``define_space_range`` can be used to plot only a restricted ROI:
spim.define_space_range(area=(12, 24, 5, 17))  # In micrometers.

Finally, the spim can be explored with the GUI:

si = SpimInterface(spim)

Esthetics of plots can be controlled by normal attribute access:

si.image.set_interpolation('spline16')
si.image.set_cmap('viridis')
si.ax_spectrum.set_facecolor('blue')

Check the docstring of each object and methods to see the numerous options available.

Todos

  • Implement a method to remove spikes from the raw data. Currently only despike.clean is used for the display but is slow. remove_spikes is on his way!
  • Implement regex formulae to read the correct parameters for initialization of Spim object directly from the filename or from file containing metadata.

Meta

Thomas Pelini - thomas.pelini@orange.fr

This project is licensed under the terms of the MIT license.

https://github.com/Tom-P7/spimcube

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

spimcube-1.3.3.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

spimcube-1.3.3-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file spimcube-1.3.3.tar.gz.

File metadata

  • Download URL: spimcube-1.3.3.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for spimcube-1.3.3.tar.gz
Algorithm Hash digest
SHA256 44cb926cb75493221d3d18a460e82f37e5fadf073931adca31dcee405185f237
MD5 e6cf7330a0fac4e2297646a24061c1af
BLAKE2b-256 a65740edc2c277365dd9e63ca42bffad4a1b1fe4d30e5b1c09fca797e8e741c7

See more details on using hashes here.

File details

Details for the file spimcube-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: spimcube-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for spimcube-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b487166457399afea66e80e7b15edc271ca2ac830321a67acdb827ce77a4dd24
MD5 cca0f179b697afb322310cb8d2852941
BLAKE2b-256 69c82ae81506639ab1ec2f3e21c439bd2e88e474df8bd2032e3a1ae6b6db0baa

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