Project
The Project serves as a container for all data and metadata associated with a particular data analysis task. It acts as the top-level entity in EasyDiffraction, ensuring structured organization and easy access to relevant information. Each project can contain multiple experimental datasets, with each dataset containing contribution from multiple structures.
EasyDiffraction allows you to:
- Manually create a new project by specifying its metadata.
- Load an existing saved project from its project directory.
Below are instructions on how to set up a project in EasyDiffraction. It
is assumed that you have already imported the easydiffraction package,
as described in the First Steps section.
Creating a Project Manually
You can manually create a new project and specify its short name, title and description. All these parameters are optional.
# Create a new project
project = ed.Project(name='lbco_hrpt')
# Define project info
project.info.title = 'La0.5Ba0.5CoO3 from neutron diffraction at HRPT@PSI'
project.info.description = """This project demonstrates a standard refinement
of La0.5Ba0.5CoO3, which crystallizes in a perovskite-type structure, using
neutron powder diffraction data collected in constant wavelength mode at the
HRPT diffractometer (PSI)."""
Saving a Project
Saving the initial project requires specifying the directory path:
project.save_as(dir_path='lbco_hrpt')
If working in the interactive mode in a Jupyter notebook or similar
environment, you can also save the project after every significant
change. This is useful for keeping track of changes and ensuring that
your work is not lost. If you already saved the project with save_as,
you can just call the save:
project.save()
Loading a Saved Project
If you have an existing saved project, load it from the project
directory created by project.save_as() or project.save(). This is
useful for continuing a previous session or reusing a downloaded saved
project.
project = ed.Project.load('lbco_hrpt')
Project Structure
The example below illustrates a typical project structure for a constant-wavelength powder neutron diffraction experiment:
📁 La0.5Ba0.5CoO3 - project root ├── 📄 project.cif - project configuration ├── 📁 structures - structures │ ├── 📄 lbco.cif - LBCO │ └── ... ├── 📁 experiments - experiments │ ├── 📄 hrpt.cif - HRPT pattern │ └── ... ├── 📁 analysis - analysis │ ├── 📄 analysis.cif - fit state │ └── 📄 results.h5 - Bayesian arrays └── 📁 reports - reports ├── 📄 La0.5Ba0.5CoO3.cif - IUCr └── 📄 La0.5Ba0.5CoO3.html - HTML
Project Files
Below is a representative project example stored in the La0.5Ba0.5CoO3
directory, showing the main files created by a typical workflow.
Important
If you save the project right after creating it, the project directory will
only contain the project.cif file. The other folders and files will be
created as you add structures, experiments, and set up the analysis. The
reports folder is created only when at least one of
project.report.cif, project.report.html, project.report.tex,
or project.report.pdf is set to True before project.save().
1. project.cif
This file stores project-level metadata and display configuration.
_project.id lbco_hrpt _project.title "La0.5Ba0.5CoO3 from neutron diffraction at HRPT@PSI" _project.description "neutrons, powder, constant wavelength, HRPT@PSI" _project.created "18 May 2026 10:15:00" _project.last_modified "18 May 2026 10:20:00" _rendering_plot.type auto _report.cif false _report.html true _report.tex false _report.pdf false _report.html_offline false _rendering_table.type auto _rendering_structure.type auto _structure_view.show_labels false _structure_style.atom_view covalent _structure_style.color_scheme jmol _verbosity.fit full
2. structures / lbco.cif
This file contains crystallographic information associated with the structure model, including space group, unit cell parameters, and atomic positions.
data_lbco _space_group.name_H-M_alt "P m -3 m" _space_group.IT_coordinate_system_code 1 _cell.length_a 3.8909(1) _cell.length_b 3.8909 _cell.length_c 3.8909 _cell.angle_alpha 90 _cell.angle_beta 90 _cell.angle_gamma 90 loop_ _atom_site.label _atom_site.type_symbol _atom_site.fract_x _atom_site.fract_y _atom_site.fract_z _atom_site.Wyckoff_symbol _atom_site.occupancy _atom_site.ADP_type _atom_site.B_iso_or_equiv La La 0 0 0 a 0.5 Biso 0.4958 Ba Ba 0 0 0 a 0.5 Biso 0.4943 Co Co 0.5 0.5 0.5 b 1 Biso 0.2567 O O 0 0.5 0.5 c 1 Biso 1.4041
3. experiments / hrpt.cif
This file contains the experiment type, calculation engine, instrumental parameters, peak parameters, associated phases, background parameters and measured diffraction data.
data_hrpt _expt_type.beam_mode "constant wavelength" _expt_type.radiation_probe neutron _expt_type.sample_form powder _expt_type.scattering_type bragg _calculator.type cryspy _instr.wavelength 1.494 _instr.2theta_offset 0.6225(4) _peak.broad_gauss_u 0.0834 _peak.broad_gauss_v -0.1168 _peak.broad_gauss_w 0.123 _peak.broad_lorentz_x 0 _peak.broad_lorentz_y 0.0797 loop_ _pd_phase_block.id _pd_phase_block.scale lbco 9.0976(3) loop_ _pd_background.line_segment_X _pd_background.line_segment_intensity _pd_background.X_coordinate 10 174.3 2theta 20 159.8 2theta 30 167.9 2theta 50 166.1 2theta 70 172.3 2theta 90 171.1 2theta 110 172.4 2theta 130 182.5 2theta 150 173.0 2theta 165 171.1 2theta loop_ _pd_meas.2theta_scan _pd_meas.intensity_total _pd_meas.intensity_total_su 10.00 167 12.6 10.05 157 12.5 10.10 187 13.3 10.15 197 14.0 10.20 164 12.5 10.25 171 13.0 ... 164.60 153 20.7 164.65 173 30.1 164.70 187 27.9 164.75 175 38.2 164.80 168 30.9 164.85 109 41.2
4. analysis / analysis.cif
This file contains settings used for data analysis, including the choice of calculation and fitting engines, as well as user defined constraints.
_fitting_mode.type single _minimizer.type lmfit loop_ _alias.label _alias.param_unique_name biso_La lbco.atom_site.La.B_iso_or_equiv biso_Ba lbco.atom_site.Ba.B_iso_or_equiv occ_La lbco.atom_site.La.occupancy occ_Ba lbco.atom_site.Ba.occupancy loop_ _constraint.id _constraint.expression biso_Ba "biso_Ba = biso_La" occ_Ba "occ_Ba = 1 - occ_La"
When a Bayesian fit stores persisted posterior or predictive arrays, the
same analysis/ directory also contains results.h5.
Now that the Project has been defined, you can proceed to the next step: Structure.