Skip to main content

Crystallite Size Calculator

crystallite-size-calculator is a Python module designed to estimate the average crystallite sizes and microstrain from powder X-ray diffraction (PXRD) data. It provides methods based on the envelope function, Williamson-Hall method, Warren-Averbach method, and Scherrer equation to accurately compute crystallite sizes and microstrains.

Features

  • Compute the radial distribution function (RDF) from PXRD data.
  • Estimate average crystallite size using the envelope function approach.
  • Calculate crystallite size and microstrain using the Williamson-Hall method.
  • Compute crystallite size using the Scherrer and modified Scherrer equations.
  • Support for advanced strain and crystallite size analysis using the Warren-Averbach method.

Installation

To install the crystallite-size-calculator module, use pip:

pip install crystallite_size_calculator

Eaxamples

Crystallite Size Calculator - CIF File Examples

Below are examples demonstrating how to use the crystallite-size-calculator module to load CIF files, compute crystallite sizes, and analyze microstrain.

1. Loading a CIF File and Computing Crystallite Size

You can load a crystal structure from a CIF file and compute the crystallite size using the envelope function approach.

from crystallite_size_calculator.crystallite_size import ComputeCrystalSizes

# Provide the path to your CIF file
cif_file = "example_structure.cif"

# Initialize the ComputeCrystalSizes class with the CIF file
calculator = ComputeCrystalSizes(cif_file=cif_file)

# Compute the crystallite size using the envelope function approach
d_crys = calculator.compute_crystallite_size_from_envelope_function()
print(f"Crystallite size from CIF file: {d_crys:.2f} nm")

# Compute crystallite size and strain using the Williamson-Hall method
strain, d_crys = calculator.size_strain_from_williamson_hall_method()
print(f"Crystallite size: {d_crys:.2f} nm, Microstrain: {strain:.4f}")

# Compute crystallite size using the Scherrer equation
d_crys = calculator.size_from_scherrer_eq()
print(f"Crystallite size using Scherrer equation: {d_crys:.2f} nm")

# Compute crystallite size and strain using the Warren-Averbach method
strain, d_crys = calculator.size_and_strain_from_warren_averbach_method()
print(f"Crystallite size: {d_crys:.2f} nm, Microstrain: {strain:.4f}")


# Compute the radial distribution function (RDF) from the CIF file
r, g_r = calculator.compute_rdf_from_diffraction_pattern()
# Print the first few r and g(r) values
print("r values:", r[:5])
print("g(r) values:", g_r[:5])

Metadata

Release files for crystallite-size-calculator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crystallite-size-calculator 0.1.0
File Size Uploaded
crystallite_size_calculator-0.1.0.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crystallite-size-calculator 0.1.0
File Interpreter ABI Platform
crystallite_size_calculator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.0 kB

Release files / crystallite_size_calculator-0.1.0.tar.gz

Download URL crystallite_size_calculator-0.1.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
579a4c435fabaa72abdba27e4f840822dd8b96f99bb5936c5f51b4889acca778
BLAKE2b-256 checksum
How to use checksums
3fa3ac52dabcc1462d089450848c825eda4decf180795e3c27326f26d9fe363c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.9 Darwin/22.1.0

Release files / crystallite_size_calculator-0.1.0-py3-none-any.whl

Download URL crystallite_size_calculator-0.1.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
980d40ce9a398d8e9efb9faf95e218a5a341546beb68f3e024a80bd1bc27a030
BLAKE2b-256 checksum
How to use checksums
447b81bd1ba23da0a979443e80e4dc8e28efedb19dab7e525b5931fb4f7d60a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.9 Darwin/22.1.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page