|
| 1 | +Files used in PDF extraction |
| 2 | +======================================================================== |
| 3 | + |
| 4 | +.. include:: abbreviations.txt |
| 5 | +.. _my-configfile: |
| 6 | +.. program:: pdfgetx3 |
| 7 | + |
| 8 | +Configuration file |
| 9 | +------------------------------------------------------------------------ |
| 10 | + |
| 11 | +Configuration files may define the PDF processing parameters. |
| 12 | +By default, the :program:`pdfgetx3` program attempts to read |
| 13 | +:file:`.pdfgetx3.cfg` file from the user HOME directory, |
| 14 | +then :file:`.pdfgetx3.cfg` and :file:`pdfgetx3.cfg` files |
| 15 | +from the current working directory. |
| 16 | +If configuration file has a different name, it needs to be specified |
| 17 | +with the :option:`-c, --config <-c>` option. |
| 18 | +The :program:`pdfgetn3` program works in the same way, |
| 19 | +except it checks for configuration files |
| 20 | +:file:`~/.pdfgetn3.cfg`, :file:`.pdfgetn3.cfg` and :file:`pdfgetn3.cfg`. |
| 21 | + |
| 22 | +The easiest way of creating a configuration file is to generate |
| 23 | +a template content using the :option:`--createconfig` option as :: |
| 24 | + |
| 25 | + pdfgetx3 --createconfig=test.cfg |
| 26 | + |
| 27 | +and then change the generated test.cfg file in your favorite text |
| 28 | +editor. The configuration file follows a simple "varname=value" syntax, |
| 29 | +any lines starting with "#" are ignored as comments. |
| 30 | + |
| 31 | +The configuration file has several sections marked as ``[SECTIONNAME]``. |
| 32 | +The ``[DEFAULT]`` section is mandatory and it contains the default |
| 33 | +global settings. Any other sections are optional and they are applied |
| 34 | +only when selected with the :option:`-s, --section <-s>` option on the |
| 35 | +command line. Thus :: |
| 36 | + |
| 37 | + pdfgetx3 --config=test.cfg --section=nacl |
| 38 | + |
| 39 | +would read the parameters from the ``[nacl]`` section after reading the |
| 40 | +defaults. Having several sections in the configuration |
| 41 | +file is useful when there are multiple measurements that share most of |
| 42 | +the parameters, but differ in a few of them, for example in chemical |
| 43 | +composition. The configuration file can then contain sections per each |
| 44 | +sample that define only the composition, while all other parameters are |
| 45 | +specified just once in the global DEFAULT section. |
| 46 | + |
| 47 | + |
| 48 | +Input files |
| 49 | +------------------------------------------------------------------------ |
| 50 | + |
| 51 | +PDFgetX3 and PDFgetN3 accept input powder diffraction data |
| 52 | +in the form of two-column text file, |
| 53 | +where the first column x is either the scattering angle |
| 54 | +|twotheta| in degrees, momentum transfer *Q* in inverse nanometers or *Q* |
| 55 | +in inverse ångströms. The second column y contains the corresponding |
| 56 | +scattered intensities normalized per unit solid angle. The actual type |
| 57 | +of the x-values is identified by the :confval:`dataformat` parameter. |
| 58 | +The input files may contain header with comments or metadata, and the |
| 59 | +actual data are read from the first long section of numerical values. |
| 60 | + |
| 61 | +The input files are usually passed as command-line arguments to |
| 62 | +:program:`pdfgetx3` or :program:`pdfgetn3` programs and must be paths |
| 63 | +accessible from the current working directory. |
| 64 | + |
| 65 | +Input files can be also defined by setting the :confval:`inputfile` |
| 66 | +value in the configuration file. The :option:`-d, --datapath <-d>` |
| 67 | +option can be then used to provide additional data directories to |
| 68 | +search for these inputs and for the :confval:`backgroundfile`. |
| 69 | +This is to support configuration files located in a different |
| 70 | +directory than the data. |
| 71 | + |
| 72 | +When the :option:`--find <-f>` option is active, the pdfgetx3 arguments |
| 73 | +are understood as filename patterns and the input files are found |
| 74 | +in the current or specified directory. |
| 75 | + |
| 76 | + |
| 77 | +Output files |
| 78 | +------------------------------------------------------------------------ |
| 79 | + |
| 80 | +PDFgetX3 and PDFgetN3 can produce up to four different output data files: |
| 81 | + |
| 82 | +* .iq -- |IQ|, the background-corrected |
| 83 | + intensities sampled on a regular *Q*-space grid in inverse ångströms, |
| 84 | + |
| 85 | +* .sq -- |SQ|, the total scattering structure function, |
| 86 | + with intensities normalized by average scattering factors and |
| 87 | + corrected by a polynomial fit, |
| 88 | + |
| 89 | +* .fq -- |FQ|, the reduced structure function equal to *Q*\ (|SQ| - 1), |
| 90 | + |
| 91 | +* .gr -- |Gr|, the resultant PDF, where the first column is the |
| 92 | + separation *r* in ångströms and the second is the function *G* in |
| 93 | + Å\ :sup:`-2`. |
| 94 | + |
| 95 | +You can specify what output files should be produced by setting the |
| 96 | +:confval:`outputtypes` parameter in the configuration file or by |
| 97 | +passing the :option:`-t, --outputtypes <-t>` on the command line. |
| 98 | + |
| 99 | +The header of all output files contains the parameter values that were |
| 100 | +used in the calculation and thus it is by itself a valid configuration |
| 101 | +file. When passed as an argument to the :option:`--config <-c>` option, |
| 102 | +the PDFgetX3 will reproduce the previous calculation. |
0 commit comments