Skip to main content

Tools to model and estimate the contrast transfer function for transmission electron microscopy data

Project description

contrasttransferfunction

PyPI - Version PyPI - Python Version


contrasttransferfunction is a python library to model and estimate the contrast transfer function for transmission electron microscopy data. The library is designed to:

  • Follow CTFFIND conventions and algorithms as much as possible
  • Be highly compatible by using pure python, no compiled code
  • Stay fast by using numpy vectorization

Installation

pip install contrasttransferfunction

Examples

Plot 1D powerspectrum

from contrasttransferfunction import ContrastTransferFunction
import matplotlib.pyplot as plt

myctf = ContrastTransferFunction(
    defocus1_angstroms = 8000,
    pixel_size_angstroms = 2.3
)

plt.plot(myctf.frequency_angstroms_1d, myctf.powerspectrum_1d)
plt.gca().xaxis.set_major_formatter(lambda x, pos: f"{1/x:.1f}Å")
plt.xlabel("Spatial resultion (A)")

Plot 2D powerspectrum

myctf = ContrastTransferFunction(
    defocus1_angstroms = 8000,
    defocus2_angstroms= 6000,
    defocus_angle_degrees=25.3,
    pixel_size_angstroms = 2.3
)
plt.imshow(myctf.powerspectrum_2d,cmap="Greys")

License

contrasttransferfunction is distributed under the terms of the MIT license.

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

contrasttransferfunction-0.0.1.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

contrasttransferfunction-0.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file contrasttransferfunction-0.0.1.tar.gz.

File metadata

File hashes

Hashes for contrasttransferfunction-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4868f1ab388423a34208c4f7f8e9eb2d3073c46c8fcd8514f6862be2fd543feb
MD5 c5cf11c088e493fb8c431586bd8465d1
BLAKE2b-256 e73222fa1cd4eff2698440f753cb75508187146fe4c0056735e1382f7003e437

See more details on using hashes here.

File details

Details for the file contrasttransferfunction-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for contrasttransferfunction-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 233556d08f9d3ad75223c343054d16c55c842c9d28780ce3b6c507aa04cda18e
MD5 67c80dc0d4a36d61e6b86ad11ee8702f
BLAKE2b-256 a9b32cc1a0a54c9134b893e5394f1312ea2f1eec03451e8a0614b0eda6880983

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