Skip to content

Commit 804d7c3

Browse files
committed
fix: add instruction and corresponding files for the example
1 parent e9c302e commit 804d7c3

File tree

3 files changed

+5325
-5
lines changed

3 files changed

+5325
-5
lines changed

docs/source/examples/diffraction_objects_example.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,19 @@ i.e.,
7575
This makes it very easy to compare a diffraction pattern that was measured or calculated
7676
on one ``xtype`` with one that was measured or calculated on another. E.g., suppose that you
7777
have a calculated powder pattern from a CIF file that was calculated on a d-spacing grid using
78-
some software package, and
79-
you want to know if a diffraction pattern you have measured on a Q-grid is the same material.
78+
some software package, which you could find in the example data folder called `CeO2_dspacing.xy` and
79+
you want to know if a diffraction pattern you have measured on a Q-grid, where the example data is also
80+
in the example data folder called `CeO2_mean_q.chi`, is the same material.
8081
You could simply load them both as diffraction objects and plot them together on the same grid.
82+
Here the `xcalc` is the first column in the `CeO2_dspacing.xy` and `ycalc` is the second column in the same
83+
file. Similarly, `xmeas` corresponds to the first column in the `CeO2_mean_q.chi` and `ymeas` is the second column in
84+
the same file.
8185

8286
.. code-block:: python
8387
84-
calculated = DiffractionObject(xcalc=[0.251436, 0.251542, 0.251647], ycalc=[-1.020020, -1.036460, -1.142070], "d")
85-
measured = DiffractionObject(xmeas=[5.343089004093959198e-03, 5.343089004093959198e-03, 2.671544437772708711e-02],
86-
ymeas=[3.533951950073242188e+01, 3.585629272460937500e+01, 3.611056518554687500e+01], "q", wavelength=0.717)
88+
calculated = DiffractionObject(xcalc, ycalc, "d")
89+
measured = DiffractionObject(xmeas,
90+
ymeas, "q", wavelength=0.1)
8791
plt.plot(calculated.on_q()[0], calculated.on_q()[1])
8892
plt.plot(measured.on_q()[0], measured.on_q()[1])
8993
plt.show()

0 commit comments

Comments
 (0)