|
1 | 1 | # %% [markdown]
|
2 |
| -# # Joint Fit (Advanced) |
| 2 | +# # Standard Diffraction: PbSO4, NPD and XRD |
3 | 3 | #
|
4 | 4 | # This example demonstrates a flexible and advanced use of the
|
5 | 5 | # EasyDiffraction library by explicitly creating and configuring objects.
|
|
20 | 20 | # %% [markdown]
|
21 | 21 | # ## Define Sample Model
|
22 | 22 | #
|
23 |
| -# This section explains how to add sample models and modify their parameters. |
| 23 | +# This section shows how to add sample models and modify their parameters. |
24 | 24 | #
|
25 | 25 | # ### Create Sample Model
|
26 | 26 |
|
|
55 | 55 | # %% [markdown]
|
56 | 56 | # ## Define Experiments
|
57 | 57 | #
|
58 |
| -# This section explains how to add experiments, configure their parameters, and |
| 58 | +# This section shows how to add experiments, configure their parameters, and |
59 | 59 | # link the sample models defined in the previous step.
|
60 | 60 | #
|
61 | 61 | # ### Experiment 1: npd
|
|
96 | 96 | # #### Set Background
|
97 | 97 |
|
98 | 98 | # %% [markdown]
|
99 |
| -# Select Background Type |
| 99 | +# Select background type. |
100 | 100 |
|
101 | 101 | # %%
|
102 | 102 | expt1.background_type = 'line-segment'
|
103 | 103 |
|
104 | 104 | # %% [markdown]
|
105 |
| -# Add Background Points |
| 105 | +# Add background points. |
106 | 106 |
|
107 | 107 | # %%
|
108 | 108 | for x, y in [
|
|
162 | 162 | # #### Set Background
|
163 | 163 |
|
164 | 164 | # %% [markdown]
|
165 |
| -# Select Background Type |
| 165 | +# Select background type. |
166 | 166 |
|
167 | 167 | # %%
|
168 | 168 | expt2.background_type = 'chebyshev polynomial'
|
169 | 169 |
|
170 | 170 | # %% [markdown]
|
171 |
| -# Add Background Points |
| 171 | +# Add background points. |
172 | 172 |
|
173 | 173 | # %%
|
174 | 174 | for x, y in [
|
|
190 | 190 | # %% [markdown]
|
191 | 191 | # ## Define Project
|
192 | 192 | #
|
193 |
| -# The project object manages the sample model, experiments, and |
| 193 | +# The project object is used to manage the sample model, experiment, and |
194 | 194 | # analysis.
|
195 | 195 | #
|
196 | 196 | # ### Create Project
|
|
214 | 214 | # %% [markdown]
|
215 | 215 | # ## Analysis
|
216 | 216 | #
|
217 |
| -# This section explains the analysis process, including how to set |
218 |
| -# up calculators and fit models. |
| 217 | +# This section shows the analysis process, including how to set up |
| 218 | +# calculation and fitting engines. |
219 | 219 | #
|
220 | 220 | # ### Set Calculator
|
221 | 221 |
|
|
237 | 237 | # %% [markdown]
|
238 | 238 | # ### Set Fitting Parameters
|
239 | 239 | #
|
240 |
| -# Set sample model parameters to be refined |
| 240 | +# Set sample model parameters to be refined. |
241 | 241 |
|
242 | 242 | # %%
|
243 | 243 | model.cell.length_a.free = True
|
244 | 244 | model.cell.length_b.free = True
|
245 | 245 | model.cell.length_c.free = True
|
246 | 246 |
|
247 | 247 | # %% [markdown]
|
248 |
| -# Set experiment parameters to be refined |
| 248 | +# Set experiment parameters to be refined. |
249 | 249 |
|
250 | 250 | # %%
|
251 | 251 | expt1.linked_phases['pbso4'].scale.free = True
|
|
277 | 277 | project.analysis.fit()
|
278 | 278 |
|
279 | 279 | # %% [markdown]
|
280 |
| -# ### Show Results |
| 280 | +# ### Plot Measured vs Calculated |
281 | 281 |
|
282 | 282 | # %%
|
283 | 283 | project.plot_meas_vs_calc(expt_name='npd',
|
|
0 commit comments