A Python package for reading and writing AxoGraph data files
Project description
axographio is a Python package that makes it easy to read and write binary data files in the AxoGraph file format.
AxoGraph is a commercial software package for data acquisition and analysis that is widely used in electrophysiological research. Although it can read and write files in text format, its binary format is much smaller and faster to load and save; thus many users preferentially use this format. The company distributes the details of the file format along with sample C++ code for reading and writing to these files using third-party software, such as this Python package.
Python is a powerful and easy to use general purpose programming language. There are many useful Python libraries available for scientific data analysis and data visualization such as SciPy, Matplotlib, and Mayavi.
This package provides a simple interface for loading AxoGraph data files into a Python program or interactive session. If you want to analyze data you recorded in AxoGraph using Python-based tools, this package provides the glue code you’ll need. You can also write data to the AxoGraph binary format so that it can be viewed and analyzed within AxoGraph.
Getting axographio
axographio is compatible with both Python 2 and Python 3.
The easiest way to get axographio is to install the latest stable version using pip, but you can alternatively build it from the source code.
Installing the latest stable version
Requirements for installing and running axographio:
The NumPy package (pip install numpy)
The axographio package contains C++ code that must be compiled. PyPI stores pre-compiled copies of the package for common platforms (e.g., Python 3 on 64-bit Windows), and these can be installed using pip.
To install the latest stable version, try the following:
pip install axographio
If a pre-compiled package is available for your platform on PyPI, pip should quickly download and install it. If not, pip will automatically attempt to build the package from source code. Building the package has additional requirements. If pip fails during building, keep reading.
Building from source code
If you need to build the package because a pre-compiled version is not already available for your platform on PyPI, or if you just want to try building from the source code, you will need to meet additional requirements.
Requirements for building axographio from source code:
The NumPy package (pip install numpy)
The Cython package, version 0.19 or later (pip install cython>=0.19)
A C++ compiler (e.g., Visual C++ Build Tools from Microsoft on Windows systems, or Xcode on Mac systems)
If pip failed while trying to build from source code, make sure you meet these requirements and try again.
If you would like to build and install using the latest development source code from GitHub, try the following:
pip install git+https://github.com/CWRUChielLab/axographio
This command requires git. If you don’t have git, you can instead manually download the source from GitHub and install from your local directory:
pip install C:\wherever-you-put-the-source-code
Usage
Try out the Binder demo for an interactive Python session that requires no installation or fuss. You can start hacking right now!
Loading a data file is as easy as calling read:
>>> import axographio >>> >>> f = axographio.read('AxoGraph X File.axgx')
At this point the variable f will contain a file_contents object with the column names and data from the file. For example, you could now plot the first two columns using Matplotlib:
>>> import matplotlib.pyplot as plt >>> >>> plt.plot(f.data[0], f.data[1]) >>> plt.xlabel(f.names[0]) >>> plt.ylabel(f.names[1]) >>> plt.show() # may be optional depending on your OS
Of course, you probably have grander plans than just plotting the data. The column data supports the standard sequence interfaces (i.e., indexing, iteration, etc.) and can be converted to a NumPy or SciPy array using the asarray functions in these packages, e.g.:
>>> import numpy as np >>> >>> times = np.asarray(f.data[0])
Writing files is also relatively easy. You simply create a new file_contents object (or use one you loaded earlier), and then call write. For example, the following code creates a file in the current directory called ‘my60Hz.axgx’ with two channels with 60 Hz sine waves:
>>> import axographio >>> import numpy as np >>> >>> times = np.arange(0, 10, 0.0001) >>> column1 = np.sin(2*np.pi * 60 * times) >>> column2 = np.cos(2*np.pi * 60 * times) >>> f = axographio.file_contents( ... ['time (s)', 'my recording (V)', 'your recording (V)'], ... [times, column1, column2]) >>> f.write('my60Hz.axgx') # created in the current directory
Questions and Support
Please post any questions, problems, comments, or suggestions in the GitHub issue tracker.
Changes
0.3.1
Modify NumPy’s global print settings only when running tests
0.3.0
Package test suite can be run using axographio.tests.run()
Package version can be accessed using axographio.__version__
Added example Jupyter notebook to source repository (not included with installation)
Updated installation instructions
Improved documentation
Reorganized source code file structure
Fixed doctests for NumPy < 1.14
0.2.0
Added compatibility with Python 3
0.1.1
Fixed a rounding error that could create one extra data point in the time column
0.1.0
First release
Acknowledgments
This initial version of this project was written in the Chiel Laboratory at Case Western Reserve University, with support from NIH grant NS047073, an Ohio Innovation Incentive Award Fellowship, and the Case Western Reserve MSTP (NIH T32 GM007250). This project builds on a number of other open source projects, including Python, C++ AxoGraph file input/output code from AxoGraph Scientific (placed in the public domain; a modified version is included with the project source code), Cython, and many others. Thanks also to Dr. Hillel Chiel for providing testing and helpful suggestions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file axographio-0.3.1.tar.gz
.
File metadata
- Download URL: axographio-0.3.1.tar.gz
- Upload date:
- Size: 59.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f951688009c9b2ed6024cc010f7efb5f42f1e87102f45b8af712a6080625f14 |
|
MD5 | f62ed4dacb775d4355fc27d7635dbac6 |
|
BLAKE2b-256 | 84bb2b40ca8f4a5fb43db372d7643656c5964535578e85731e9c69b83af609f3 |
Provenance
File details
Details for the file axographio-0.3.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 100.7 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 633963e9069b8c7cd593bea9ca8c50b3b4880ad9e1b4eeedaf4701135f72a210 |
|
MD5 | 4107190d238ead770a6dde67c655fc96 |
|
BLAKE2b-256 | 5ec47e9438f558a28194dde3e9e5b297ebabe5a038d11f1507ccf2964e86cf26 |
Provenance
File details
Details for the file axographio-0.3.1-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 101.4 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6457291e171e4f54f9d74c62173233f506e86b941cab528ac8b3d1f5821ce386 |
|
MD5 | fc02548e2a25bda336d1c16b3ac81904 |
|
BLAKE2b-256 | ee1b550312375b6ce0a2d8627803304eacc857156f8c2a1bfc01744c285a7b53 |
Provenance
File details
Details for the file axographio-0.3.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 99.2 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd962e986dc8b9bd99840270631ad174ff63e06de633b8a0585998cf3719613c |
|
MD5 | ace93c3f563df34b9b0fcc7b655aa026 |
|
BLAKE2b-256 | dda5bc6b8979fef57cc2278b0a46f013e800ecd50de47b097075ac4e9c9b8076 |
Provenance
File details
Details for the file axographio-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 116.6 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24abc27b444fc21915dd933d1a893850e690dd559b1d968dcbbdc03574fa5f1a |
|
MD5 | 05aba32ab9bbb31a5f3ffcfa6d8a2a22 |
|
BLAKE2b-256 | e4079fedf01d5197ab2d41726bc735de7b3452f3e38fa35827245cf29221796d |
Provenance
File details
Details for the file axographio-0.3.1-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 95.7 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4440f0f447204c397809aba6dd7b4351ad8d2ad1e1a077de5f2e2926e577e1e |
|
MD5 | 866408c67ef9156c3b635675413f52f7 |
|
BLAKE2b-256 | 4f5d67bc180f44dbecaa75297e4afc9be15650d306f9da21f43d5b02cc3faf24 |
Provenance
File details
Details for the file axographio-0.3.1-cp36-cp36m-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp36-cp36m-macosx_10_7_x86_64.whl
- Upload date:
- Size: 126.6 kB
- Tags: CPython 3.6m, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fff6de7048e01e77a3691f80b56fe92e6095d5449572645447fb7326a5d04981 |
|
MD5 | 2ae8bc2fe1a41d56500230b34541ba36 |
|
BLAKE2b-256 | cd662b63388d3587b51c4e9c9a917f489d720b9539a697dd412714d117cc6c6c |
Provenance
File details
Details for the file axographio-0.3.1-cp27-cp27m-win_amd64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp27-cp27m-win_amd64.whl
- Upload date:
- Size: 98.5 kB
- Tags: CPython 2.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 581e33a32d942c24ab572f52d6c7f7efc7f9161025411f17c8e30ac0e3286f4d |
|
MD5 | 2fd7e934f9904aeb13826126b7e47bb7 |
|
BLAKE2b-256 | 3f02088f3486dc1be06ad48f627104bc352a26a77830925dbad7a014f8a007ff |
Provenance
File details
Details for the file axographio-0.3.1-cp27-cp27m-macosx_10_6_x86_64.whl
.
File metadata
- Download URL: axographio-0.3.1-cp27-cp27m-macosx_10_6_x86_64.whl
- Upload date:
- Size: 128.2 kB
- Tags: CPython 2.7m, macOS 10.6+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff6c9632652958a36f452574eee5878b13f35425d62734ce0f8ea3d70f36387c |
|
MD5 | 5c688d7f574bb6407ef3f69825212ca1 |
|
BLAKE2b-256 | 5ed95611b00021d7b4e05912a9f8ee9063629ef82a98c5f8bf2507e05405bfe6 |