Skip to main content

A Python interface for the TRPX compression algorithm

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.


Before you consider pyterse

  • Your data is signed or unsigned integral type.
  • Your data is grayscale.
  • Preferably has high dynamic range.

How to install the package

Create a virtual environment

conda create -n pyterse python pip numpy pillow 

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) #nD NumPy array or slice from an 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 entry to Terse object:
terse.push_back(data) #The NumPy array or slice from a nD array should correspond to existing set shape (terse.shape).
  • Save compressed data to a file:
terse.save('filename.trpx')
  • Load compressed data from a file:
loaded_terse = Terse.load('filename.trpx')
  • Decompress the data:
decompressed_frame = loaded_terse.prolix()
  • Decompress a specific entry:
decompressed_frame = loaded_terse.prolix(n)
# You can check the number of entries by terse.number_of_entries()
  • Add and retrieve metadata to the terse object:
terse.set_attribute('distance', '487.0')
terse.get_attribute('distance')
terse.get_attributes() #Retrieves all set atributes

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyterse-0.1.3-cp311-cp311-win_amd64.whl (117.1 kB view details)

Uploaded CPython 3.11Windows x86-64

pyterse-0.1.3-cp311-cp311-win32.whl (100.7 kB view details)

Uploaded CPython 3.11Windows x86

pyterse-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (131.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyterse-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (115.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyterse-0.1.3-cp310-cp310-win_amd64.whl (115.8 kB view details)

Uploaded CPython 3.10Windows x86-64

pyterse-0.1.3-cp310-cp310-win32.whl (99.8 kB view details)

Uploaded CPython 3.10Windows x86

pyterse-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (130.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyterse-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (113.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyterse-0.1.3-cp39-cp39-win_amd64.whl (113.9 kB view details)

Uploaded CPython 3.9Windows x86-64

pyterse-0.1.3-cp39-cp39-win32.whl (99.8 kB view details)

Uploaded CPython 3.9Windows x86

pyterse-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (130.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyterse-0.1.3-cp39-cp39-macosx_11_0_arm64.whl (113.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file pyterse-0.1.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyterse-0.1.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 117.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyterse-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d03a0c7529e335054788cf34d7c9bb2f02187d50548a359b269b99d2a3e14f0c
MD5 4a704754ed1305dca2a2e10ccd6e4c70
BLAKE2b-256 58d6b31adb110510c14057ef8c914cc0074fca0467b0a03d5f3a92870125dfa5

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp311-cp311-win32.whl.

File metadata

  • Download URL: pyterse-0.1.3-cp311-cp311-win32.whl
  • Upload date:
  • Size: 100.7 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyterse-0.1.3-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 fdaf7de7c254174f8272a60a16826520e8f4592367395bd208af5ece2a9d752d
MD5 c65d5f50b52ab36f98b22a42aec7594e
BLAKE2b-256 8de1dcf091c129e4e995ba0182b8d3c3a142c0e52b8678c49f57c695f05134fc

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyterse-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 530e1934f0ab678ff8e78b7545026ecfc009b5e6926bddba25d5eb5bb61933f1
MD5 b41bc6af9406ef31cc240ffa355fcbaf
BLAKE2b-256 66f42e705b327f794c19d0a0f787805a6582c8c44b8ef7855cefaed336c0b438

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyterse-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3ceba68f07562331ecdea39a00272833a2d3b4c57cb8da8c048285dc614b9169
MD5 e8ed55643811a81f1a49a52460eeb43f
BLAKE2b-256 70a2b52b7707578d6daf6a38ebb3701ca187a44b4d8b44b518573c7bcf9fb65d

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyterse-0.1.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 115.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyterse-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cadaa6731dd75a33611f962b61842758602d05379418b6e1cd48719d25980779
MD5 1f493550a2df41d4ec2bdbdda86bcae1
BLAKE2b-256 45cd41275f8db085abfd40ede561d0839127678e0c1e89ef112053dbc9018d53

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp310-cp310-win32.whl.

File metadata

  • Download URL: pyterse-0.1.3-cp310-cp310-win32.whl
  • Upload date:
  • Size: 99.8 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyterse-0.1.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 3c989a4bf508e8237bdca5c69dd2577a160e21782d831edb177749f9cde79838
MD5 c0b8773180856a5570e2728f4d7f6a4c
BLAKE2b-256 d9c25695dbdb1d84a2dc14b167a9fc85ebe2e8c459caf821a59eddea37295e63

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyterse-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 382cc04195cd6c1911ffc77e58515a9f3d613b37bd2435f2add5032af16ba2fd
MD5 dd4c02228bd2828d56e7c55f377a8d80
BLAKE2b-256 2347794aab01daa4334efef8cb783664613c89820727dacac67a6d568d314080

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyterse-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e41b62b294b57b8bec03a75b9985623e8cf9fa73598927c211d010322277a4cc
MD5 fc02f963e19ed7335b6e3b007d8b3ab7
BLAKE2b-256 c3a18a9846501260dca3c5aeff8d852cb310418ef4f8d926edafbc596b591b19

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyterse-0.1.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 113.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyterse-0.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e8a862a3a125698983488eb17e8447252c46df0e3931ba661d10c40d02aa13b7
MD5 351543e4ea142b0ab8b76cbd3c58a83a
BLAKE2b-256 02280bcd55f12880db1617f6d2db6191fb80af46061ca2b411026aabe865ec82

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp39-cp39-win32.whl.

File metadata

  • Download URL: pyterse-0.1.3-cp39-cp39-win32.whl
  • Upload date:
  • Size: 99.8 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyterse-0.1.3-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 ac028d6b3aaf01d6df29192cc75f105999312c00fe0f53fe2f8d3e53ac9e36fe
MD5 1ec682c9c49c753253cd94737bde3264
BLAKE2b-256 9be24130b7f8b67962d6f20ba7d004dbad8d97adee9c9c738b22fc67e84c3d1f

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyterse-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6e9b129b78202d43e80de3bab5b74766ae72db4123e364e2f483537d5dc2a7a1
MD5 dcc0004b7ee7097ed17f12568abe1e4c
BLAKE2b-256 86dcf005c8f1d7fed2461b63122c17ee978ac56662b8d5b1df0aa5a9d4716dd3

See more details on using hashes here.

File details

Details for the file pyterse-0.1.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyterse-0.1.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c6a4046b7c14ce72cfeb46c388818220fd5c31bf003ea351dc04ae88597281d
MD5 7d994490471cb46bcd636f8226a891fd
BLAKE2b-256 1dc0d7ab327adda628d522ff6bd1028e4ac9229ea46b9e3c2a5754678a42b1b6

See more details on using hashes here.

Supported by

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