Parameters
The data analysis process, introduced in the Concept section, assumes that you mainly work with different parameters. The parameters are used to describe the sample model and the experiment and are required to set up the analysis.
Each parameter in EasyDiffraction has a specific name used for code reference, and it belongs to a specific category.
- In many cases, the EasyDiffraction name is the same as the CIF name.
- In some cases, the EasyDiffraction name is a slightly modified version of the
CIF name to comply with Python naming conventions. For example,
name_H-M_alt
becomesname_h_m
, replacing hyphens with underscores and using lowercase letters. - In rare cases, the EasyDiffraction name is a bit shorter, like
b_iso
instead of CIFB_iso_or_equiv
, to make the code a bit more user-friendly. - When there is no defined CIF name for a parameter, EasyDiffraction introduces
its own name, which is used in the code as well as an equivalent CIF name to
be placed in the custom CIF dictionary
easydiffractionCIF
.
EasyDiffraction names are used in code, while CIF names are used to store and retrieve the full state of a data analysis project in CIF format. You can find more about the project in the Project section.
Parameter Attributes
Parameters in EasyDiffraction are more than just variables. They are objects that, in addition to the name and value, also include attributes such as the description, unit, uncertainty, minimum and maximum values, etc. All these attributes are described in the API Reference section. Examples of how to use these parameters in code are provided in the Analysis Workflow and Tutorials sections.
The most important attribute, besides name
and value
, is free
, which is
used to define whether the parameter is free or fixed for optimization during
the fitting process. The free
attribute is set to False
by default, which
means the parameter is fixed. To optimize a parameter, set free
to True
.
Although parameters are central, EasyDiffraction hides their creation and
attribute handling from the user. The user only accesses the required parameters
through the top-level objects, such as project
, sample_models
,
experiments
, etc. The parameters are created and initialized automatically
when a new project is created or an existing one is loaded.
In the following sections, you can see a list of the parameters used in EasyDiffraction. Use the tabs to switch between how to access a parameter in code and its CIF name for serialization.
Important
Remember that parameters are accessed in code through their parent objects,
such as project
, sample_models
, or experiments
. For example, if you
have a sample model with the ID nacl
, you can access the space group name
using the following syntax:
project.sample_models['nacl'].space_group.name_h_m
In the example above, space_group
is a sample model category, and name_h_m
is the parameter. For simplicity, only the last part (category.parameter
) of
the full access name will be shown in the tables below.
In addition, the CIF names are also provided for each parameter, which are used to serialize the parameters in the CIF format.
Tags defining the corresponding experiment type are also given before the table.
Sample model parameters
Below is a list of parameters used to describe the sample model in EasyDiffraction.
Crystall structure parameters
pd-neut-cwl pd-neut-tof pd-xray sc-neut-cwl
Category | Parameter | How to access in the code |
---|---|---|
space_group | name_hm | space_group.name_hm |
system_code | space_group.system_code | |
cell | length_a | cell.length_a |
length_b | cell.length_b | |
length_c | cell.length_c | |
angle_alpha | cell.angle_alpha | |
angle_beta | cell.angle_beta | |
angle_gamma | cell.angle_gamma | |
atom_site | label | atom_sites['ID'].label |
type_symbol | atom_sites['ID'].type_symbol | |
fract_x | atom_sites['ID'].fract_x | |
fract_y | atom_sites['ID'].fract_y | |
fract_z | atom_sites['ID'].fract_z | |
occupancy | atom_sites['ID'].occupancy | |
adp_type | atom_sites['ID'].adp_type | |
b_iso | atom_sites['ID'].b_iso | |
multiplicity | atom_sites['ID'].multiplicity | |
wyckoff_letter | atom_sites['ID'].wyckoff_letter |
Category | Parameter | CIF name for serialization | CIF dictionary |
---|---|---|---|
space_group | name_hm | _space_group.name_H-M_alt | coreCIF |
system_code | _space_group.IT_coordinate_system_code | coreCIF | |
cell | length_a | _cell.length_a | coreCIF |
length_b | _cell.length_b | coreCIF | |
length_c | _cell.length_c | coreCIF | |
angle_alpha | _cell.angle_alpha | coreCIF | |
angle_beta | _cell.angle_beta | coreCIF | |
angle_gamma | _cell.angle_gamma | coreCIF | |
atom_site | label | _atom_site.label | coreCIF |
type_symbol | _atom_site.type_symbol | coreCIF | |
fract_x | _atom_site.fract_x | coreCIF | |
fract_y | _atom_site.fract_y | coreCIF | |
fract_z | _atom_site.fract_z | coreCIF | |
occupancy | _atom_site.occupancy | coreCIF | |
adp_type | _atom_site.ADP_type | coreCIF | |
b_iso | _atom_site.B_iso_or_equiv | coreCIF | |
multiplicity | _atom_site.site_symmetry_multiplicity | coreCIF | |
wyckoff_letter | _atom_site.Wyckoff_symbol | coreCIF |
Experiment parameters
Below is a list of parameters used to describe the experiment in EasyDiffraction.
Common parameters
pd-neut-cwl pd-neut-tof pd-xray sc-neut-cwl
Category | Parameter | How to access in the code |
---|---|---|
expt_type | beam_mode | expt_type.beam_mode |
radiation_probe | expt_type.radiation_probe | |
sample_form | expt_type.sample_form | |
scattering_type | expt_type.scattering_type |
Category | Parameter | CIF name for serialization | CIF dictionary |
---|---|---|---|
expt_type | beam_mode | _expt_type.beam_mode | easydiffractionCIF |
radiation_probe | _expt_type.radiation_probe | easydiffractionCIF | |
sample_form | _expt_type.sample_form | easydiffractionCIF | |
scattering_type | _expt_type.scattering_type | easydiffractionCIF |
Standard powder diffraction
pd-neut-cwl pd-neut-tof pd-xray
Category | Parameter | How to access in the code |
---|---|---|
background | x | background.x |
y | background.y | |
order | background.order | |
coef | background.coef | |
linked_phases | scale | linked_phases['ID'].scale |
Category | Parameter | How to access in the code |
---|---|---|
instrument | setup_wavelength | instrument.setup_wavelength |
calib_twotheta_offset | instrument.calib_twotheta_offset | |
peak | broad_gauss_u | peak.broad_gauss_u |
broad_gauss_v | peak.broad_gauss_v | |
broad_gauss_w | peak.broad_gauss_w | |
broad_lorentz_x | peak.broad_lorentz_x | |
broad_lorentz_y | peak.broad_lorentz_y |
Category | Parameter | CIF name for serialization | CIF dictionary |
---|---|---|---|
instrument | setup_wavelength | _instrument.setup_wavelength | easydiffractionCIF |
calib_twotheta_offset | _instrument.calib_twotheta_offset | easydiffractionCIF | |
peak | broad_gauss_u | _peak.broad_gauss_u | easydiffractionCIF |
broad_gauss_v | _peak.broad_gauss_v | easydiffractionCIF | |
broad_gauss_w | _peak.broad_gauss_w | easydiffractionCIF | |
broad_lorentz_x | _peak.broad_lorentz_x | easydiffractionCIF | |
broad_lorentz_y | _peak.broad_lorentz_y | easydiffractionCIF |
Category | Parameter | How to access in the code |
---|---|---|
instrument | setup_twotheta_bank | instrument.setup_twotheta_bank |
calib_d_to_tof_recip | instrument.calib_d_to_tof_recip | |
calib_d_to_tof_offset | instrument.calib_d_to_tof_offset | |
calib_d_to_tof_linear | instrument.calib_d_to_tof_linear | |
calib_d_to_tof_quad | instrument.calib_d_to_tof_quad | |
peak | broad_gauss_sigma_0 | peak.broad_gauss_sigma_0 |
broad_gauss_sigma_1 | peak.broad_gauss_sigma_1 | |
broad_gauss_sigma_2 | peak.broad_gauss_sigma_2 | |
broad_mix_beta_0 | peak.broad_mix_beta_0 | |
broad_mix_beta_1 | peak.broad_mix_beta_1 | |
asym_alpha_0 | peak.asym_alpha_0 | |
asym_alpha_1 | peak.asym_alpha_1 |
Category | Parameter | CIF name for serialization | CIF dictionary |
---|---|---|---|
instrument | setup_twotheta_bank | _instrument.setup_twotheta_bank | easydiffractionCIF |
calib_d_to_tof_recip | _instrument.calib_d_to_tof_recip | easydiffractionCIF | |
calib_d_to_tof_offset | _instrument.calib_d_to_tof_offset | easydiffractionCIF | |
calib_d_to_tof_linear | _instrument.calib_d_to_tof_linear | easydiffractionCIF | |
calib_d_to_tof_quad | _instrument.calib_d_to_tof_quad | easydiffractionCIF | |
peak | broad_gauss_sigma_0 | _peak.broad_gauss_sigma_0 | easydiffractionCIF |
broad_gauss_sigma_1 | _peak.broad_gauss_sigma_1 | easydiffractionCIF | |
broad_gauss_sigma_2 | _peak.broad_gauss_sigma_2 | easydiffractionCIF | |
broad_mix_beta_0 | _peak.broad_mix_beta_0 | easydiffractionCIF | |
broad_mix_beta_1 | _peak.broad_mix_beta_1 | easydiffractionCIF | |
asym_alpha_0 | _peak.asym_alpha_0 | easydiffractionCIF | |
asym_alpha_1 | _peak.asym_alpha_1 | easydiffractionCIF |
Total scattering
Category | Parameter | How to access in the code |
---|---|---|
peak | cutoff_q | peak.cutoff_q |
broad_q | peak.broad_q | |
sharp_delta_1 | peak.sharp_delta_1 | |
sharp_delta_2 | peak.sharp_delta_2 | |
damp_q | peak.damp_q | |
damp_particle_diameter | peak.damp_particle_diameter |
Category | Parameter | CIF name for serialization | CIF dictionary |
---|---|---|---|
peak | cutoff_q | _peak.cutoff_q | easydiffractionCIF |
broad_q | _peak.broad_q | easydiffractionCIF | |
sharp_delta_1 | _peak.sharp_delta_1 | easydiffractionCIF | |
sharp_delta_2 | _peak.sharp_delta_2 | easydiffractionCIF | |
damp_q | _peak.damp_q | easydiffractionCIF | |
damp_particle_diameter | _peak.damp_particle_diameter | easydiffractionCIF |