Skip to content

Commit ffada85

Browse files
docs: initial commit for quick start tutorial
1 parent 89de7c2 commit ffada85

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed

doc/source/examples/examples.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ Examples
77
Landing page for diffpy.labpdfproc examples.
88

99
.. toctree::
10+
labpdfprocapp_example
1011
functions_example
1112
tools_example
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. _labpdfprocapp Example:
2+
3+
:tocdepth: -1
4+
5+
labpdfprocapp Example
6+
#####################
7+
8+
This example provides a quick-start tutorial for using ``diffpy.labpdfproc``.
9+
It will demonstrate how to apply absorption correction to your 1D diffraction data
10+
using either the command-line (CLI) or graphical user interface (GUI).
11+
For more details, run ``labpdfproc --help``.
12+
13+
1. In order to use this app,
14+
you will need: (1) your input diffraction data file(s), and (2) information required to compute the mu*D value.
15+
To launch the GUI, use either ``labpdfproc`` or ``labpdfproc --gui``.
16+
Note that the GUI currently does not support Python 3.13.
17+
18+
2. Here we provide a basic example first.
19+
Assume you have an uncorrected data called zro2_mo.xy in the current directory with a muD of 2.5 in two-theta.
20+
Then the minimum command would be:
21+
22+
.. code-block:: python
23+
24+
labpdfproc zro2_mo.xy --mud 2.5
25+
26+
3. You must provide at least one file path.
27+
In the GUI, the file browser supports selecting multiple files, but not entire folders.
28+
To include directories in GUI mode, you can:
29+
(1) create a text file named ``file_list.txt`` listing the desired paths and load it,
30+
(2) select all files in a folder manually,
31+
(3) manually enter file paths separated by semicolons.
32+
33+
4. You can specify the wavelength in different ways:
34+
35+
.. code-block:: python
36+
37+
# manually enter wavelength
38+
labpdfproc zro2_mo.xy --mud 2 -w 0.71303
39+
# use a known anode_type
40+
labpdfproc zro2_mo.xy --mud 2 -a Mo
41+
42+
5. To specify the output directory where the corrected data should be saved:
43+
44+
.. code-block:: python
45+
46+
labpdfproc zro2_mo.xy --mud 2 -w 0.71303 -o "output_dir"
47+
48+
This will save the processed data into the folder ``output_dir``.
49+
50+
6. Additional options:
51+
- ``xtype``: choose the x-axis variable for your diffraction data.
52+
- You can also choose to output the cve file as well (via ``-o`` in CLI or checkbox in GUI).
53+
- Use the overwrite option carefully - it will replace existing files.
54+
- You are encouraged to input user information to help save progress and support reproducibility.
55+
56+
.. code-block:: python
57+
58+
labpdfproc zro2_mo.xy --mud 2 -n Joe -e Joe@email.com --orcid 0000-0000-0000-0000
59+
60+
61+
You can also enter this information during input prompts or store it in a diffpy configuration file.
62+
For a full tutorial, refer to the documentation on ``diffpy.utils``.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _labpdfprocapp Utility:
2+
3+
labpdfprocapp Utility
4+
=====================
5+
6+
The ``diffpy.labpdfproc.labpdfprocapp`` module provides both a command-line (CLI) and graphical user interface (GUI)
7+
for processing diffraction data, applying absorption correction, and saving the output files.
8+
9+
- ``get_args()``: This function parses all CLI arguments.
10+
11+
- ``gooey_parser()``: This function provides a GUI for argument input.
12+
13+
- ``main()``: This function validates all arguments, performs preprocessing, and saves the output files.
14+
15+
For a more in-depth tutorial for how to get started, click :ref:`here <labpdfprocapp Example>`.

doc/source/utilities/utilities.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ Check the :ref:`examples<Examples>` provided for how to use these.
1010
.. contents::
1111
:depth: 2
1212

13+
.. include:: labpdfprocapp_utility.rst
1314
.. include:: functions_utility.rst
1415
.. include:: tools_utility.rst

0 commit comments

Comments
 (0)