A Python interface for the TERSE library using pybind11.
Project description
Pyterse
Python package of TERSE/PROLIX diffraction and cryo-EM data compression algorithm
The pyterse python package uses the c++ TERSE/PROLIX(TRPX) compression algorithm scheme (https://github.com/senikm/trpx) and adds python binders to it's main class. After the compilation the build directory contains the python compression library, which can be imported to a python environment.
How to install the package
pip install pyterse
Testing the functionality of the library
Basic commands
- Create terse object:
from pyterse import Terse
# Constructor 1
terse = Terse()
# Constuctor 2
terse = Terse(data) #2d NumPy array or slice from a 3D array
# Constuctor 3
terse = Terse(data, data.size, block_size) #Provide the frame size and the costum block size: default is 12
- Example:
terse = Terse(data, 512* 512, 12)
- Add additional frame to Terse object:
terse.push_back(data) #2d NumPy array or slice from a 3D array
- Save compressed data to a file:
terse.save('filename.trpx')
- Load compressed data from a file:
terse = Terse.load('filename.trpx')
- Decompress a specific frame:
decompressed_frame = loaded_terse.prolix(frame_index).reshape(terse.dim)
- Add metadata to the terse object:
terse.set_attribute('distance', '487.0')
terse.set_attribute('pixel_size', '0.055 0.055')
terse.set_attribute('trusted_range', '0 65535')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyterse-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyterse-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 131.6 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4637d4689a9ecb345a7b8ab8b6b88212e4702423a8d3cbeec64ef763bc798a5e
|
|
| MD5 |
04e47cc86fb568c9bbd9be59e8bb505c
|
|
| BLAKE2b-256 |
ee2d95c7035d3a2e6b88725f764acef1c5da77caf54ca462558d4722929a4caa
|
File details
Details for the file pyterse-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyterse-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 114.8 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9a05dc01a9d2195000cbdd3389d6b41d85bb3a96e46e1a373e9f036985a3028
|
|
| MD5 |
691d999baa88da131ff67536cac91429
|
|
| BLAKE2b-256 |
3f3429b15ea6ebf15ebc16ed7bfd2d48b598b231cf5df887f186192c8a867382
|
File details
Details for the file pyterse-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyterse-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 129.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72f00261d88d1cfda98db90a4ee1bdbbbc190d2a762ba2c6853fdb9ccf610ac2
|
|
| MD5 |
b4c83ef9f9f7d7d040d13b1e8216f5ae
|
|
| BLAKE2b-256 |
ee18fe3f392cdb74d16bf5664193719cbe9e4b9a81db691f1f622dff86ebb817
|
File details
Details for the file pyterse-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyterse-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 113.3 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
829786ae6f864eeae092ce61acbdbc8c43f6d2d4ee4a4ebcc8ed2f29bcd7ab86
|
|
| MD5 |
47baa0f46dd53585bd358cf9d81b9769
|
|
| BLAKE2b-256 |
ea2b64355de34608a8cd22205ea8cd1fdd932ea647731a6d2b9add310fb53299
|
File details
Details for the file pyterse-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyterse-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 130.2 kB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a19ed55905fa1af25abed488f2f09856aad3caa3a788703cf609ec0eaf902c0c
|
|
| MD5 |
51fa0e273be6df46cce34460daa4bfcf
|
|
| BLAKE2b-256 |
8b6bb0db3390b542218bac6c2162eec691d428cafb731bde519618bc943435cc
|
File details
Details for the file pyterse-0.1.1-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyterse-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 113.5 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c026daa970d411e47acb744b0f1f9be3bf922834b17e3b595175a4b9004631d
|
|
| MD5 |
2e07f6d5a9d200d1ad13d5accf759d75
|
|
| BLAKE2b-256 |
263a1ee0bee9a20f6a5ab49fa5e2c0140112bfd86831bfcededd1ec959b2e5fa
|