Skip to content

Commit 14b7299

Browse files
initial commit
1 parent 112d0a1 commit 14b7299

File tree

11 files changed

+17
-15
lines changed

11 files changed

+17
-15
lines changed
File renamed without changes.

doc/source/examples/examples.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Examples
77
Landing page for diffpy.utils examples.
88

99
.. toctree::
10-
parsersexample
11-
resampleexample
12-
toolsexample
10+
parsers_example
11+
resample_example
12+
tools_example
13+
transforms_example
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Parsers Example
88
This example will demonstrate how diffpy.utils lets us easily process and serialize files.
99
Using the parsers module, we can load file data into simple and easy-to-work-with Python objects.
1010

11-
1) To begin, unzip :download:`parserdata<./exampledata/parserdata.zip>` and take a look at ``data.txt``.
11+
1) To begin, unzip :download:`parser_data<./example_data/parser_data.zip>` and take a look at ``data.txt``.
1212
Our goal will be to extract and serialize the data table as well as the parameters listed in the header of this file.
1313

1414
2) To get the data table, we will use the ``loadData`` function. The default behavior of this
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Specifically, we will resample the grid of one function to match another for us
1010
Then we will show how this resampling method lets us create a perfect reconstruction of certain functions
1111
given enough datapoints.
1212

13-
1) To start, unzip :download:`parserdata<./exampledata/parserdata.zip>`. Then, load the data table from ``Nickel.gr``
13+
1) To start, unzip :download:`parser_data<./example_data/parser_data.zip>`. Then, load the data table from ``Nickel.gr``
1414
and ``NiTarget.gr``. These datasets are based on data from `Atomic Pair Distribution Function Analysis: A Primer
1515
<https://global.oup.com/academic/product/atomic-pair-distribution-function-analysis-9780198885801?cc=us&lang=en&>`_.
1616
::

doc/source/examples/transformsexample.rst renamed to doc/source/examples/transforms_example.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ This example will demonstrate how to use the functions in the
1313
to convert it to ``2theta`` or ``d``. ::
1414

1515
# Example: convert q to 2theta
16-
from diffpy.utils.transformers import q_to_tth
16+
from diffpy.utils.transforms import q_to_tth
1717
wavelength = 0.71
1818
q = np.array([0, 0.2, 0.4, 0.6, 0.8, 1])
1919
tth = q_to_tth(q, wavelength)
2020

2121
# Example: convert q to d
22-
from diffpy.utils.transformers import q_to_d
22+
from diffpy.utils.transforms import q_to_d
2323
q = np.array([0, 0.2, 0.4, 0.6, 0.8, 1])
2424
d = q_to_d(q)
2525

2626
(2) Converting from ``2theta`` to ``q`` or ``d``:
2727
For a 1D ``2theta`` array, you can convert it to ``q`` or ``d`` in a similar way. ::
2828

2929
# Example: convert 2theta to q
30-
from diffpy.utils.transformers import tth_to_q
30+
from diffpy.utils.transforms import tth_to_q
3131
wavelength = 0.71
3232
tth = np.array([0, 30, 60, 90, 120, 180])
3333
q = tth_to_q(tth, wavelength)
3434

3535
# Example: convert 2theta to d
36-
from diffpy.utils.transformers import tth_to_d
36+
from diffpy.utils.transforms import tth_to_d
3737
wavelength = 0.71
3838
tth = np.array([0, 30, 60, 90, 120, 180])
3939
d = tth_to_d(tth, wavelength)
@@ -42,12 +42,12 @@ This example will demonstrate how to use the functions in the
4242
For a 1D ``d`` array, you can convert it to ``q`` or ``2theta``. ::
4343

4444
# Example: convert d to q
45-
from diffpy.utils.transformers import tth_to_q
45+
from diffpy.utils.transforms import tth_to_q
4646
d = np.array([1.0, 0.8, 0.6, 0.4, 0.2])
4747
q = d_to_q(d)
4848

4949
# Example: convert d to 2theta
50-
from diffpy.utils.transformers import d_to_tth
50+
from diffpy.utils.transforms import d_to_tth
5151
wavelength = 0.71
5252
d = np.array([1.0, 0.8, 0.6, 0.4, 0.2])
5353
tth = d_to_tth(d, wavelength)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Resample Utility
44
================
55

6-
- ``wsinterp()``: Allows users easily reample a PDF onto another grid.
6+
- ``wsinterp()``: Allows users easily resample a PDF onto another grid.
77
This makes use of the Whittaker-Shannon interpolation formula.
88
To see the theory behind how this interpolation works and how to use
99
it in practice, click :ref:`here <Resample Example>`.
File renamed without changes.

0 commit comments

Comments
 (0)