contrasttransferfunction
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.
Metadata
Release files for contrasttransferfunction 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| contrasttransferfunction-0.0.1.tar.gz | 5.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| contrasttransferfunction-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.2 MB
Release files / contrasttransferfunction-0.0.1.tar.gz
| Download URL | contrasttransferfunction-0.0.1.tar.gz |
|---|---|
| Size | 5.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4868f1ab388423a34208c4f7f8e9eb2d3073c46c8fcd8514f6862be2fd543feb
|
|
BLAKE2b-256 checksum How to use checksums |
e73222fa1cd4eff2698440f753cb75508187146fe4c0056735e1382f7003e437
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.24.0
|
Release files / contrasttransferfunction-0.0.1-py3-none-any.whl
| Download URL | contrasttransferfunction-0.0.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
233556d08f9d3ad75223c343054d16c55c842c9d28780ce3b6c507aa04cda18e
|
|
BLAKE2b-256 checksum How to use checksums |
a9b32cc1a0a54c9134b893e5394f1312ea2f1eec03451e8a0614b0eda6880983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.24.0
|