You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. note:: Note that the GUI is currently not supported on Python>=3.12.
38
37
39
-
This command will process ``"SiO2 uncorrected.xy"``,
40
-
all files in the ``input_dir`` directory, all files listed in ``file_list.txt``,
41
-
all ``.chi`` files in the current directory, and all files matching the pattern ``data``,
42
-
using a muD value of 2.5.
43
-
Check ``labpdfproc --help`` to see all supported file types.
38
+
This will open the GUI, which should look something like,
44
39
45
-
In the GUI, you can select multiple individual files via the file browser, but not entire directories.
46
-
To include directories, you can either:
47
-
(1) create a text file named ``file_list.txt`` containing the desired paths and load it,
48
-
(2) manually select all files in a folder, or
49
-
(3) enter paths manually separated by a colon with no spaces.
40
+
.. image:: ../img/labpdfproc-gui.jpeg
41
+
:align:center
50
42
51
-
We will now continue using ``zro2_mo.xy`` as the example input throughout the rest of this tutorial.
43
+
Below we will go through all the commands using the CLI, but the same principles apply to the GUI.
52
44
45
+
.. note:: The first time you run any of the below commands,
46
+
you will be prompted to enter your name, email, and ORCID. This will be
47
+
appended to metadata in the output file header for reproducibility and tracking purposes.
53
48
54
-
4. The muD value is required for absorption correction, and you can specify it in one of the four ways:
55
49
56
-
.. code-block:: python
50
+
``labpdfproc mud`` Command
51
+
---------------------------
57
52
58
-
# Option 1: Manual value
59
-
labpdfproc zro2_mo.xy --mud 2.5
60
-
# Option 2: From a z-scan file
61
-
labpdfproc zro2_mo.xy -z zscan.xy
62
-
# Option 3: Using sample mass density
63
-
labpdfproc zro2_mo.xy -d ZrO2,17.45,1.2
64
-
# Option 4: Using packing fraction
65
-
labpdfproc zro2_mo.xy -p ZrO2,17.45,0.2
53
+
If you know the muD value for your sample, you can use the ``labpdfproc mud``
54
+
command to apply absorption correction directly.
66
55
67
-
Note that you can only use one method at a time. The following examples are not allowed:
56
+
To see all the options for this command, type,
68
57
69
-
.. code-block:: python
58
+
.. code-block:: bash
70
59
71
-
labpdfproc zro2_mo.xy --mud 2.5-z zscan.xy
72
-
labpdfproc zro2_mo.xy --mud 2.5-d ZrO2,17.45,1.2
60
+
labpdfproc mud -h
73
61
74
-
If the packing fraction option is not supported at the moment, you can approximate the sample mass density as:
75
-
``mass density = packing fraction * material density``, where the material density can be looked up manually.
62
+
To run the correction, specify the path to your diffraction data file(s) and the muD value,
76
63
64
+
.. code-block:: bash
77
65
78
-
5. You can specify the wavelength in two ways:
66
+
labpdfproc mud <diffraction-data-file.xy><mud>
67
+
labpdfproc mud zro2_mo.xy 2.5
79
68
80
-
.. code-block:: python
69
+
If the flag ``--wavelength`` is not specified, the program will attempt to fetch
70
+
the wavelength from a configuration file.
71
+
If the wavelength is not found in the configuration file, a ``ValueError``
72
+
will be raised, prompting you to provide the wavelength either through the CLI or the configuration file.
81
73
82
-
# Option 1: Manually enter wavelength
83
-
labpdfproc zro2_mo.xy --mud 2.5-w 0.71303
84
-
# Option 2: Use a known anode type
85
-
labpdfproc zro2_mo.xy --mud 2.5-a Mo
74
+
To provide the wavelength through the CLI, you can use the ``-w`` or ``--wavelength`` flag followed by the wavelength value in angstroms or the X-ray source.
75
+
For example,
86
76
87
-
Do not use both ``-w`` and ``-a`` at the same time. For example:
77
+
.. code-block:: bash
88
78
89
-
.. code-block:: python
79
+
labpdfproc mud zro2_mo.xy 2.5 -w 0.71303
80
+
labpdfproc mud zro2_mo.xy 2.5 -w Mo
90
81
91
-
labpdfproc zro2_mo.xy --mud 2.5-w 0.71303-a Mo
82
+
This will then save the corrected file in the same directory as the input file with the name ``zro2_mo_corrected.chi``.
92
83
93
-
is not valid. This is to avoid confusion when wavelength conflicts with anode type.
94
-
To avoid retyping, you can save your wavelength or anode type in a diffpy configuration file.
95
-
See full instructions at https://www.diffpy.org/diffpy.labpdfproc/examples/tools_example.html.
84
+
To save the correction file, specify the ``-c`` or ``--output-correction`` flag,
96
85
86
+
.. code-block:: bash
97
87
98
-
6. You are also encouraged to provide your information (name, email, and orcid) for reproducibility:
88
+
labpdfproc mud zro2_mo.xy 2.5 -w 0.71303 -c
99
89
100
-
.. code-block:: python
90
+
This will then save the correction file in the same directory as the input file with the name ``zro2_mo_cve.chi``.
101
91
102
-
labpdfproc zro2_mo.xy --mud 2.5-n Joe -e Joe@email.com --orcid 0000-0000-0000-0000
92
+
``labpdfproc zscan`` Command
93
+
----------------------------
103
94
95
+
The ``labpdfproc zscan`` command allows you to calculate the muD value from a z-scan file and apply absorption correction to your diffraction data.
96
+
For more information on what a z-scan is, please see the "Examples --> Linear Absorption Coefficient Examples"
97
+
section in the ``diffpy.utils`` documentation: https://www.diffpy.org/diffpy.utils/examples/mu_calc_examples.html.
104
98
105
-
Alternatively, you can enter this information during the interactive prompts
106
-
or save it in your diffpy configuration file.
107
-
For more details, refer to https://www.diffpy.org/diffpy.utils/examples/tools_example.html.
99
+
To see the options for this command, type,
108
100
101
+
.. code-block:: bash
109
102
110
-
7. You can further customize the diffraction correction process using the following options:
103
+
labpdfproc zscan -h
111
104
112
-
- Choose xtype: use ``-x`` to specify your input data's xtype, which will be used for the output.
113
-
- Select correction method: use ``-m`` to choose between "brute_force" or "polynomial_interpolation" (faster and preferred for muD 0.5-7).
114
-
- Specify output directory: use ``-o`` to save the corrected file(s) to a specific folder.
115
-
- Add custom metadata: use ``-u`` to provide key-value pair for information tracking (e.g., experimental details).
116
-
- Output the cve file: use ``-c`` to export the cve file along with the corrected data.
117
-
- Overwrite existing files: use ``-f`` to replace any previous corrected files with the same names.
105
+
To run this command, provide the path to your diffraction data file(s) and the z-scan file,
118
106
107
+
.. code-block:: bash
119
108
120
-
8. To summarize, a full command might look like this:
This will then save the correction file in the same directory as the input file with the name ``CeO2_635um_accum_0_cve.chi``.
129
+
130
+
``labpdfproc sample`` Command
131
+
-----------------------------
132
+
133
+
The ``labpdfproc sample`` command allows you to calculate the muD value from information
134
+
about your sample and apply absorption correction to your diffraction data.
135
+
136
+
To see the options for this command, type,
137
+
138
+
.. code-block:: bash
139
+
140
+
labpdfproc sample -h
141
+
142
+
To run this command, provide the path to your diffraction data file(s) along with:
143
+
144
+
1) ``sample_composition``: The chemical formula of your sample.
145
+
2) ``sample_mass_density``: The mass density of your sample in g/cm^3. If you don't know the mass density, a good approximation is typically ~1/3 of the theoretical packing fraction.
146
+
3) ``diameter``: The outer diameter of your capillary.
0 commit comments