crystalipf
This is an easy-to-use library to create inverse pole-figures (ipf) for crystal lattices with cubic symmetry.
Installation
The library can be installed in three different ways:
- Install it from the Python Package Index.
pip install crystalipf
- Clone the repository and install it.
git clone https://github.com/silvioachilles/crystalipf.git cd crystalipf pip install .
- Copy
crystalipf/cubic.pyto your project and include it in your code.
Usage
An orientation must be expressed as an orientation matrix. In the code snippet below it is shown how to retrieve the rgb color of the orientation and its position in the ipf.
import numpy as np
import matplotlib.pyplot as plt
from crystalipf.cubic import position, rgb, image, image_plt, edges
# example orientation matrix of a grain
grain = np.array([
[ 0.71825437, -0.68019413, 0.14644661],
[ 0.68019413, 0.6421339, -0.35355339],
[ 0.14644661, 0.35355339, 0.92387953]
])
# sample direction
g = np.array([0, 0, 1])
# ipf position
grain_ipf_x, grain_ipf_y = position(grain, g)
# ipf color
grain_ipf_rgb = rgb(grain, g)
# to illustrate, the grain's orientation is plotted
# in the ipf with respective coloring
fig, ax = plt.subplots()
ax.scatter([grain_ipf_x], [grain_ipf_y], c=[grain_ipf_rgb])
# the edges of the ipf
ipf_edges_xs, ipf_edges_ys = edges()
ax.plot(ipf_edges_xs, ipf_edges_ys)
ax.axis('off')
plt.show()
Using the image_plt function, you can create a matplotlib plot of a fully
colored ipf with annotations for the corners.
fig, ax = plt.subplots()
image_plt(ax)
plt.show()
An raw image of a fully colored ipf can be retrieved with the image function,
allowing to create a customized ipf plot.
fig, ax = plt.subplots()
ipf_image, xmax, ymax = image()
ax.imshow(ipf_image, extent=0, xmax, 0, ymax)
ax.plot(ipf_edges_xs, ipf_edges_ys, c='black')
plt.show()
Troubleshooting
Please open a github issue if anything appears not correct.
Metadata
Release files for crystalipf 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 | Provenance | Actions |
|---|---|---|---|---|
| crystalipf-0.0.1.tar.gz | 9.9 kB | Without provenance | Details for crystalipf-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crystalipf-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for crystalipf-0.0.1-py3-none-any.whl |
Total release size: 18.9 kB
Release files / crystalipf-0.0.1.tar.gz
| Download URL | crystalipf-0.0.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fff4f5e3e56ad6ea316ff010374b2b7041c88c8ab34de011ba2d19556e363913
|
|
BLAKE2b-256 checksum How to use checksums |
761589e5b1dbb4aece44b0f5ae98fa24ceaa8e412a5b20f6f1f0bf7f39109d0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.12
|
Release files / crystalipf-0.0.1-py3-none-any.whl
| Download URL | crystalipf-0.0.1-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
593170d6a69aaaeb5d6cf14efe678f3f6bd508a1a2ebfa0128506a6f6607029c
|
|
BLAKE2b-256 checksum How to use checksums |
8e3a1ed0e6429b7bb4385bcfa61ade94e368ac8ead8de3e413da93483eeee9d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.12
|
Security for crystalipf 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.