Skip to content

Repository files navigation

python_test

Overview

CBF is a simple Python package (Python 3.x) for reading and writing cbf (Crystallographic Binary Format) files.

Installation

Pip

To install the package via pip use:

# install the latest tagged version (in this case 1.3.0)
pip install git+https://github.com/paulscherrerinstitute/cbf.git@1.3.0

# install the latest development version
pip install git+https://github.com/paulscherrerinstitute/cbf.git

Usage

  • Read CBF file
import cbf
content = cbf.read('example.cbf')

numpy_array_with_data = content.data
header_metadata = content.metadata

# Plot image with matplot lib
from matplotlib import pyplot as plt
plt.imshow(numpy_array_with_data, cmap='gray', vmax=50)
plt.show()
  • Write CBF file
import cbf
cbf.write('example.cbf', numpy_array)

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages