BLAND: A Stimulating Method for 

the Analysis of Diffraction Patterns

Joseph Lesniewski

Mount Saint Mary's University / NIST Center for Neutron Research

Georgetown University
Overview

Crystal Structure

Model Refinement

Bayesian Data Analysis
UNIT CELL

Image: ctcms.nist.gov
Unit Cell Types

Image: chem.purdue.edu
Bragg’s Law: 2dd sin θθ = λλ

Bragg Diffraction

Image: microscopy.ethz.ch
Diffractometer

Crystalline powder

Ideally give same 

diffraction pattern

Images: ncnr.nist.gov, theochem.unito.it
Reality

Images: ncnr.nist.gov, theochem.unito.it
(Juan Rodríguez-Carvajal)

• Allows hand fitting using Gauss-Newton Algorithm

• Similar to GSAS, TOPAS, etc.

• Uses PCR files to handle fits

• Powered by CrysFML Library

COMM Test G.Courbion data on Na2Ca3Al2F14 3T2 (Diam: 6mm H=50mm)

! Current global Chi2 (Bragg contrib.) = 3.265 

! Files => DAT-file: ncaf_3t2.dat, PCR-file: ncaf_3t2

!Job Npr Nph Nba Nex Nsc Nor Dum Iwg Ilo Ias Res Ste Nre Cry Uni Cor Opt Aut

1 7 2 -1 2 0 1 0 0 0 1 0 0 0 0 0 0 0 1

!

!Ipr Ppl Ioc Mat Pcr Ls1 Ls2 Ls3 NLI Prf Ins Rpa Sym Hkl Fou Sho Ana

0 2 1 2 1 0 4 0 0 1 6 -1 1 0 0 0 0

!

! Lambda1 Lambda2 Ratio Bkpos Wdt Cthm muR AsyLim Rpolarz 2nd-muR -> Patt# 1

1.225300 1.225300 0.00000 30.000 10.0000 0.0000 0.0000 35.00 0.0000 0.0000

!

!NCY Eps R_at R_an R_pr R_gl Thmin Step Thmax PSD Sent0

8 0.05 1.00 1.00 1.00 1.00 0.0000 0.050000 125.4500 0.000 0.000

!

! Excluded regions (LowT HighT) for Pattern# 1

0.00 5.00

125.00 180.00

! 

!

51 !Number of refined parameters
Gauss-Newton Algorithm
• Markov Chain

• Monte Carlo

• Differential Evolution

Bayesian Data Analysis

Dream Fitting Algorithm
BUMPS

Bayesian Uncertainty Modeling of Parametric Systems
BLAND
Bayesian

Library for

Analysis of

Neutron

Diffraction data
1 2 3 4 1 2 3 // 4

Assumption Possible Reality

Origin

• Pain-staking hand written wrapper code

• Wrapped only a small portion of Fortran library

• Unstable due to unsafe assumptions concerning memory 

layout of Fortran derived types

 Automated Global Fitting

 Eliminate need for intuition
PyCrysfml Library

• Uses custom version of FortWrap (fortwrap.sourceforge.net) to 

generate C++ wrapper for use with SWIG (swig.org)

• Automatic build script wraps entire library into native python module

• Greater stability

• Adaptable to changes in library
GOALS

Automated Global Fitting

Eliminate need for intuition

 Reliability

 Adaptability

 Magnetism

 Single Crystal Patterns
EXAMPLE FITS
PBSO4 Pre-fit
Image:spongebob.wikia.com
PbSO4

Parameter Value 95% Interval

O1 x 0.90905528 [ 0.9082, 0.9095]

O1 z 0.59574381 [ 0.5951, 0.5964]

O2 x 0.19283123 [ 0.1924, 0.1937]

O2 z 0.54258205 [ 0.5418, 0.5434]

O3 x 0.08115299 [0.08077, 0.08152]

O3 y 0.02822131 [ 0.0277, 0.0288]

O3 z 0.80712467 [0.80669, 0.80758]

Pb B 0.37401401 [ 0.32, 0.51]

Pb x 0.18722964 [0.18689, 0.18752]

Pb z 0.16717933 [0.16676, 0.16767]

S x 0.06487234 [ 0.0641, 0.0663]

S z 0.68541183 [ 0.6839, 0.6866]

base 213.475422 [ 212.53, 217.71]

a 8.47815771 [8.47788, 8.47844]

b 5.39688196 [5.39672, 5.39710]

c 6.95830693 [6.95801, 6.95853]

eta 0.45188095 [ 0.03, 0.47]

scale 1.14508016 [ 1.065, 1.152]

u 0.15538536 [ 0.142, 0.163]

v -0.3615733 [ -0.380, -0.330]

w 0.37466735 [ 0.361, 0.412]

zero -0.1387589 [-0.1420, -0.1359]
Ho2BaNiO5

Parameter Value [ 95% interval]

Ho C0 0.145 [ 0.08 0.21]

Ho C1 9.063 [ 9.00 9.11]

Ni C0 0.699 [ 0.57 0.83]

Ni C1 -1.321 [ -1.37 -1.27]

base 6719.97 [6711.10 6720.00]

a 3.7542 [3.75391 3.75454]

b 5.7299 [5.72951 5.73043]

c 11.26 [11.2683 11.2708]

eta 0.0993 [ 0.052 0.107]

scale 57.949 [ 57.23 58.43]

u 1.589 [ 1.52 1.66]

v -1.006 [ -1.07 -0.94]

w 0.3375 [ 0.326 0.352]

zero 0.08465 [ 0.0820 0.0869]

Ho2BaNiO5 Results
LuFe0.66Mn0.33O3
LuFe0.66Mn0.33O3
Parameter value

[ 95% 

interval]

Fe1 C0 4.752 [ 3.85 5.22]

Fe1 C1 -7.56 [ -19.0 19.0]

Fe1 C2 -1.392 [ -1.63 1.63]

extinction 0.002 [ 0.02 2.44]

scale 1.626 [ 1.53 2.26]

LuFe0.66Mn0.33O3 Results
FUTURE GOALS

User-friendly interface

Model fitting

NICE integration

Take over the world
Acknowledgements

William Ratcliff

Paul Kienzle

Dylan Quintana

Julie Borchers

SURF directors