CeCoAl₃ on POLARIS¶
Fit CeCoAl₃ to time-of-flight neutron powder data from POLARIS at ISIS: structure and profile, with a 24-term Chebyshev background.
The project is the catalogue case pd-neut-tof_cecoal-polaris, the one the command line and the
app's Examples open.
Fitting
Single pd neut tof Bragg
Crystal structure
import easydiffraction as edi
Load the project¶
project_path = edi.download_data('pd-neut-tof_cecoal-polaris', destination='data')
project = edi.Project.load(project_path)
structure = project.structures['cecoal']
experiment = project.experiments['polaris']
Data 'pd-neut-tof_cecoal-polaris' is at data/pd-neut-tof_cecoal-polaris-e1e721892155/pd-neut-tof_cecoal-polaris
The project marks what its fit frees. The fit below frees it in stages, so start with all of it fixed.
for parameter in project.free_parameters:
parameter.free = False
project.display.pattern('polaris')
Perform the analysis¶
The fit goes in stages, freeing one group of parameters at a time.
Scale, time-of-flight calibration and cell¶
The scale, the DIFC offset and its quadratic term, and the three cell lengths put the peaks in place and at the right height.
experiment.linked_structures['cecoal'].scale.free = True
experiment.instrument.calib_d_to_tof_offset.free = True
experiment.instrument.calib_d_to_tof_quadratic.free = True
structure.cell.length_a.free = True
structure.cell.length_b.free = True
structure.cell.length_c.free = True
project.display.parameters.free()
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 6 free
iter time (s) Rwp (%) reduced χ² change
11.38 84.57
1 0.094 4.17 11.38 86.5% ↓
2 0.163 4.13 11.14 2.2% ↓
3 0.232 4.13 11.13 0.1% ↓
4 0.405 4.13 11.13
done · converged · 4 iters · reduced χ² 11.13 · Rwp 4.13 % · 0.50 s
project.display.pattern('polaris')
Background¶
The first twelve polynomial terms (orders 0 to 11) follow the level between the peaks; the higher ones stay at zero.
for term in list(experiment.background_terms)[:12]:
term.coef.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 18 free
iter time (s) Rwp (%) reduced χ² change
4.13 11.17
1 0.145 2.32 3.51 68.5% ↓
2 0.211 2.31 3.51 0.1% ↓
3 0.356 2.31 3.51
done · converged · 3 iters · reduced χ² 3.51 · Rwp 2.31 % · 0.45 s
project.display.pattern('polaris')
Peak widths¶
experiment.peak.broad_gauss_sigma_1.free = True
experiment.peak.broad_lorentz_gamma_1.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 20 free
iter time (s) Rwp (%) reduced χ² change
2.31 3.51
1 0.151 2.31 3.51 0.2% ↓
2 0.250 2.31 3.51
3 0.405 2.31 3.51
done · converged · 3 iters · reduced χ² 3.51 · Rwp 2.31 % · 0.50 s
project.display.pattern('polaris')
Atom positions¶
The coordinates the symmetry leaves free.
for site in structure.atom_sites:
for coordinate in (site.fract_x, site.fract_y, site.fract_z):
coordinate.free = not coordinate.symmetry_constrained
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 25 free
iter time (s) Rwp (%) reduced χ² change
2.31 3.51
1 0.160 2.14 3.00 14.4% ↓
2 0.242 2.14 3.00 0.1% ↓
3 0.345 2.14 3.00
4 0.501 2.14 3.00
done · converged · 4 iters · reduced χ² 3.00 · Rwp 2.14 % · 0.60 s
project.display.pattern('polaris')
Displacements¶
for site in structure.atom_sites:
site.adp_iso.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 30 free
iter time (s) Rwp (%) reduced χ² change
2.14 3.01
1 0.158 2.10 2.90 3.6% ↓
2 0.236 2.10 2.89 0.2% ↓
3 0.337 2.10 2.89
4 0.492 2.10 2.89
done · converged · 4 iters · reduced χ² 2.89 · Rwp 2.10 % · 0.60 s
project.display.pattern('polaris')
Absorption¶
Absorption weakens the intensities with time of flight, as the displacements do with angle, so it comes after them, on its own.
experiment.absorption.abscor1.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 31 free
iter time (s) Rwp (%) reduced χ² change
2.10 2.90
1 0.153 2.09 2.87 0.9% ↓
2 0.233 2.09 2.86 0.3% ↓
3 0.315 2.08 2.86 0.1% ↓
4 0.423 2.08 2.86
5 0.581 2.08 2.86
done · converged · 5 iters · reduced χ² 2.86 · Rwp 2.08 % · 0.68 s
project.display.pattern('polaris')
Al3 occupancy¶
Last, Al3's occupancy, which moves with its displacement.
structure.atom_sites['Al3'].occupancy.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-tof_cecoal-polaris, 3692 pts fitted / 3693 loaded, 32 free
iter time (s) Rwp (%) reduced χ² change
2.08 2.86
1 0.157 2.08 2.85 0.2% ↓
2 0.260 2.08 2.85
3 0.415 2.08 2.85
done · converged · 3 iters · reduced χ² 2.85 · Rwp 2.08 % · 0.52 s
project.display.pattern('polaris')
project.display.fit.correlations()
project.display.structure('cecoal')
Save the project¶
project.save_as('pd-neut-tof_cecoal-polaris')
project.report.save_html('pd-neut-tof_cecoal-polaris.html')
Saving project to 'pd-neut-tof_cecoal-polaris'
Saving report to 'pd-neut-tof_cecoal-polaris.html'