Skip to main content

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

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.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (114.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyterse-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (129.9 kB view details)

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

pyterse-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (113.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyterse-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (130.2 kB view details)

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

pyterse-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (113.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

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

File hashes

Hashes for pyterse-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4637d4689a9ecb345a7b8ab8b6b88212e4702423a8d3cbeec64ef763bc798a5e
MD5 04e47cc86fb568c9bbd9be59e8bb505c
BLAKE2b-256 ee2d95c7035d3a2e6b88725f764acef1c5da77caf54ca462558d4722929a4caa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyterse-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9a05dc01a9d2195000cbdd3389d6b41d85bb3a96e46e1a373e9f036985a3028
MD5 691d999baa88da131ff67536cac91429
BLAKE2b-256 3f3429b15ea6ebf15ebc16ed7bfd2d48b598b231cf5df887f186192c8a867382

See more details on using hashes here.

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

File hashes

Hashes for pyterse-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 72f00261d88d1cfda98db90a4ee1bdbbbc190d2a762ba2c6853fdb9ccf610ac2
MD5 b4c83ef9f9f7d7d040d13b1e8216f5ae
BLAKE2b-256 ee18fe3f392cdb74d16bf5664193719cbe9e4b9a81db691f1f622dff86ebb817

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyterse-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 829786ae6f864eeae092ce61acbdbc8c43f6d2d4ee4a4ebcc8ed2f29bcd7ab86
MD5 47baa0f46dd53585bd358cf9d81b9769
BLAKE2b-256 ea2b64355de34608a8cd22205ea8cd1fdd932ea647731a6d2b9add310fb53299

See more details on using hashes here.

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

File hashes

Hashes for pyterse-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a19ed55905fa1af25abed488f2f09856aad3caa3a788703cf609ec0eaf902c0c
MD5 51fa0e273be6df46cce34460daa4bfcf
BLAKE2b-256 8b6bb0db3390b542218bac6c2162eec691d428cafb731bde519618bc943435cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyterse-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c026daa970d411e47acb744b0f1f9be3bf922834b17e3b595175a4b9004631d
MD5 2e07f6d5a9d200d1ad13d5accf759d75
BLAKE2b-256 263a1ee0bee9a20f6a5ab49fa5e2c0140112bfd86831bfcededd1ec959b2e5fa

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