@@ -10,7 +10,9 @@ This example will demonstrate how to use the functions in the
10
10
11
11
1) Converting from ``q `` to ``2theta `` or ``d ``:
12
12
If you have a 1D ``q ``-array, you can use the ``q_to_tth `` and ``q_to_d `` functions
13
- to convert it to ``2theta `` or ``d ``. ::
13
+ to convert it to ``2theta `` or ``d ``.
14
+
15
+ .. code-block :: python
14
16
15
17
# Example: convert q to 2theta
16
18
from diffpy.utils.transforms import q_to_tth
@@ -24,7 +26,9 @@ This example will demonstrate how to use the functions in the
24
26
d = q_to_d(q)
25
27
26
28
(2) Converting from ``2theta `` to ``q `` or ``d ``:
27
- For a 1D ``2theta `` array, you can convert it to ``q `` or ``d `` in a similar way. ::
29
+ For a 1D ``2theta `` array, you can convert it to ``q `` or ``d `` in a similar way.
30
+
31
+ .. code-block :: python
28
32
29
33
# Example: convert 2theta to q
30
34
from diffpy.utils.transforms import tth_to_q
@@ -39,7 +43,9 @@ This example will demonstrate how to use the functions in the
39
43
d = tth_to_d(tth, wavelength)
40
44
41
45
(3) Converting from ``d `` to ``q `` or ``2theta ``:
42
- For a 1D ``d `` array, you can convert it to ``q `` or ``2theta ``. ::
46
+ For a 1D ``d `` array, you can convert it to ``q `` or ``2theta ``.
47
+
48
+ .. code-block :: python
43
49
44
50
# Example: convert d to q
45
51
from diffpy.utils.transforms import d_to_q
0 commit comments