La₀.₅Ba₀.₅CoO₃ on HRPT¶
Calculate a constant-wavelength neutron pattern of the cubic perovskite La₀.₅Ba₀.₅CoO₃ without any measured data. The structure, the HRPT instrument, the peak profile and the background are in the project, and edi calculates the pattern over the project's 2θ range.
The project is the catalogue case pd-neut-cwl_lbco_simulation: the files the command line fits
with python -m edi fit docs/user/cli/pd-neut-cwl_lbco_simulation/project and the app opens from
its Examples.
Simulation
Single pd neut cwl Bragg
Crystal structure
import easydiffraction as edi
Load the project¶
project_path = edi.download_data('pd-neut-cwl_lbco_simulation', destination='data')
project = edi.Project.load(project_path)
print(project.metadata.title)
print('Structures:', ', '.join(structure.name for structure in project.structures))
print('Experiments:', ', '.join(experiment.name for experiment in project.experiments))
print('Fitting mode:', project.fitting_mode)
Data 'pd-neut-cwl_lbco_simulation' is at data/pd-neut-cwl_lbco_simulation-156565971ae8/pd-neut-cwl_lbco_simulation
La₀.₅Ba₀.₅CoO₃ [Pm-3m] · HRPT @ PSI
Structures: lbco
Experiments: hrpt
Fitting mode: single
Calculate¶
There is nothing to fit: edi calculates the pattern from the model as it is.
project.calculate()
pattern = project.experiments[0].data
print(len(pattern.intensity_calc), 'points, highest', round(max(pattern.intensity_calc), 1))
3001 points, highest 4134.2
Patterns and report¶
The HTML report draws the measured, calculated and difference patterns with the reflection positions, and lists the structure and the fit. Open it in a browser.
project.report.save_html('pd-neut-cwl_lbco_simulation.html')
Saving report to 'pd-neut-cwl_lbco_simulation.html'
Save¶
save_as writes the project with its new values to a folder of its own; the catalogue's copy
stays as it was.
project.save_as('pd-neut-cwl_lbco_simulation')
Saving project to 'pd-neut-cwl_lbco_simulation'
Explore the interactive report¶
Run the cell and trust the notebook to interact with the report. It includes Plotly plots and three.js structures where available.
project.report.html_offline = True
project.report