7272 data_on_d = my_do.on_xtype(" d" )
7373 plt.plot(data_on_d[0 ], data_on_d[1 ])
7474
75- This makes it very easy to compare a diffractioh pattern that was measured or calculated
75+ This makes it very easy to compare a diffraction pattern that was measured or calculated
7676on one ``xtype `` with one that was measured or calculated on another. E.g., suppose that you
7777have a calculated powder pattern from a CIF file that was calculated on a d-spacing grid using
7878some software package, and
@@ -85,7 +85,7 @@ You could simply load them both as diffraction objects and plot them together on
8585 measured = DiffractionObject(xmeas, ymeas, " tth" , wavelength = 0.717 )
8686 plt.plot(calculated.on_q()[0 ], calculated.on_q()[1 ])
8787 plt.plot(measured.on_q()[0 ], measured.on_q()[1 ])
88- plt.show
88+ plt.show()
8989
9090 Now, let's say that these two diffraction patterns were on very different scales. The measured one
9191has a peak intensity of 10,000, but the calculated one only goes to 1.
@@ -100,8 +100,8 @@ we would replace the code above with
100100.. code-block :: python
101101
102102 plt.plot(calculated.on_q()[0 ], calculated.on_q()[1 ])
103- plt.plot(measured.on_q(). scale_to(calculated, q = 5.5 )[0 ], measured.on_q(). scale_to(calculated, q = 5.5 )[1 ])
104- plt.show
103+ plt.plot(measured.scale_to(calculated, q = 5.5 ).on_q() [0 ], measured.scale_to(calculated, q = 5.5 ).on_q( )[1 ])
104+ plt.show()
105105
106106 The ``scale_to() `` method returns a new ``DiffractionObject `` which we can assign to a new
107107variable and make use of,
@@ -134,7 +134,7 @@ DiffractionObject convenience functions
134134 diff_object2 = diff_object1.copy()
135135 diff_object2 == diff_object1
136136
137- will return `` True ``
137+ will return ``True ``.
138138
1391393) make arithmetic operations on the intensities of diffraction objects. e.g.,
140140
@@ -149,7 +149,7 @@ DiffractionObject convenience functions
149149.. code-block :: python
150150
151151 tth_ninety_index = diff_object1.get_array_index(90 , xtype = " tth" )
152- intensity_at_ninety = diff_object1.on_tth()[tth_ninety_index]
152+ intensity_at_ninety = diff_object1.on_tth()[1 ][ tth_ninety_index]
153153
154154 If you do not specify an ``xtype ``, it will default to the ``xtype `` used when creating the ``DiffractionObject ``.
155155For example, if you have created a ``DiffractionObject `` called ``do `` with ``xtype="q" ``,
@@ -168,6 +168,7 @@ in ``diffpy.utils.parsers``).
168168You can choose which of the data axes (``q ``, ``tth ``, or ``d ``) to export, with ``q `` as the default.
169169
170170.. code-block :: python
171+
171172 # Assume you have created a Diffraction Object do
172173 file = " diffraction_data.chi"
173174 do.dump(file , xtype = " q" )
0 commit comments