Skip to main content

Electron Diffraction Refinement Engine - SHELXL-compatible crystallographic refinement for 3D ED/microED

Project description

EDref

Pipeline Status Coverage PyPI version Python versions License: MIT

Electron Diffraction Refinement - SHELXL-compatible least-squares refinement with dynamical scattering correction for 3D ED data.

Installation

pip install edref

Quick Start

# Basic refinement
edref structure.ins --edref

# With dynamical correction (recommended for ED data)
edref structure.ins --edref --dyn-power

# Anisotropic with dynamical correction
edref structure.ins --edref --dyn-power --aniso

Dynamical Scattering Correction

EDref can correct for dynamical scattering effects that cause systematic intensity errors in electron diffraction data:

# Power-shape model (recommended)
edref structure.ins --edref --dyn-power

# With fixed parameters (no auto-optimization)
edref structure.ins --edref --dyn-power-params 0.8 0.3

Available models:

Flag Parameters Description
--dyn-power α, γ Power-shape correction (recommended)
--dyn-exp α, d_decay Exponential decay
--dyn-abs α, d_half, γ Absolute intensity model
--dynamical1 κ Simple 1-parameter

Auto-Dyn Workflow

Automated refinement with cascading outlier removal:

# Auto-dyn with dynamical correction
edref structure.ins --auto-dyn --dyn-power

# With anisotropic refinement and weight optimization
edref structure.ins --auto-dyn --dyn-power --aniso --refine-weights

The auto-dyn workflow:

  1. Initial refinement (50 cycles)
  2. Cascading Z-threshold outlier removal (Z=8, 6, 4)
  3. Re-refinement after each omit round

Common Options

# Resolution limits (d_max to d_min in Angstrom)
edref structure.ins --edref --resolution 20 0.8

# Number of refinement cycles
edref structure.ins --edref --cycles 100

# Extinction correction
edref structure.ins --edref --exti

# R-free cross-validation
edref structure.ins --edref --rfree

# Custom output path
edref structure.ins --edref --output refined/mystructure

Iterative Outlier Removal

For manual control over outlier removal:

edref structure.ins --edref --dyn-power --iterative \
    --iter-threshold 4 \
    --iter-rounds 10

Output Files

EDref generates:

  • structure_edref.res - Refined structure (SHELXL format)
  • structure_edref.fcf - Structure factors (Olex2-compatible)
  • structure_corrected.hkl - Dynamically-corrected intensities
  • structure_edref_refine.png - Refinement diagnostics
  • structure_edref_outliers.png - Outlier analysis

SHELXL Comparison

# Run SHELXL only
edref structure.ins --shelxl

# Compare EDref vs SHELXL
edref structure.ins --compare

Key Features

  • Dynamical correction - Multiple models for ED intensity correction
  • Auto-dyn workflow - Automated outlier removal with cascading thresholds
  • SHELXL-compatible - Reads/writes standard .ins/.res/.hkl/.fcf files
  • Olex2-compatible - FCF output works directly in Olex2
  • R-free validation - Cross-validation to detect overfitting
  • Anisotropic ADPs - Full anisotropic refinement support
  • Special positions - Automatic constraint detection

Requirements

  • Python >= 3.10
  • NumPy, SciPy, Matplotlib

Documentation

License

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

edref-3.7.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edref-3.7.3-py3-none-any.whl (190.9 kB view details)

Uploaded Python 3

File details

Details for the file edref-3.7.3.tar.gz.

File metadata

  • Download URL: edref-3.7.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for edref-3.7.3.tar.gz
Algorithm Hash digest
SHA256 323d93d12e6c18ce16f7637274602b4e0f42d1e334e470cdc4d5f8a9dad79a9d
MD5 bf95213741c41b21d263dcc4946b745b
BLAKE2b-256 f0667a06eb06275d68aafb4c4aaacf050c0bcde7acac45b779966bdc5f1c8f73

See more details on using hashes here.

File details

Details for the file edref-3.7.3-py3-none-any.whl.

File metadata

  • Download URL: edref-3.7.3-py3-none-any.whl
  • Upload date:
  • Size: 190.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for edref-3.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 02d3e1362b10e1dfd819dbb0af9c403d73de1d1ad7e433c864c570b69b9fd398
MD5 008a2c5083c453e5961a0e9fac2c87c2
BLAKE2b-256 a5b07520e8c58a8ee60a8f3e09b394e259ee68e0aa28f470598946074848712a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page