diff --git a/docs/source/experiment.rst b/docs/source/experiment.rst index 4481c9c..875322c 100644 --- a/docs/source/experiment.rst +++ b/docs/source/experiment.rst @@ -350,13 +350,18 @@ should be created for each configuration that requires a change in the instrument calibration (wavelength, detector distance, detector translation) or scan angles. +The detector is chosen from a pull-down menu that contains all the +detectors defined in the *PyFAI* package. This defines the number of +pixels, their size, and a mask array used to exclude all the pixels +within gaps between the detector chips. + Calibrate Powder ---------------- This dialog will import a TIFF or CBF file containing measurements of a powder calibrant and refine the detector position and coordinates, using -the PyFAI API. Alternatively, if the calibration parameters are already -available in a PONI file, they can be directly imported. The resulting -powder data and calbration parameters are then saved to the +the *PyFAI* API. Alternatively, if the calibration parameters are +already available in a PONI file, they can be directly imported. The +resulting powder data and calbration parameters are then saved to the configuration template previously created using the *New Configuration* dialog. @@ -441,3 +446,44 @@ powder calibration data and parameters to the configuration file. The calibration parameters can also be saved to a PONI file, using the "Export Calibration" button. This process should be repeated for each entry, after which the dialog can be closed. + +Create Mask +----------- +This dialog creates a pixel mask that is used to exclude bad pixels from +further analysis. As described above, when a new configuration file is +created, a pixel mask that excludes gaps between detector chips is +automatically added. Additional pixels can be excluded using this +dialog, either by adding editable shapes that are constructively added +to the existing mask or by importing the mask from an external file, +which can store the mask in any image format. The latter is useful if a +beamline regularly updates a particular detector's mask as bad pixels are identified. + +.. warning:: If an external mask is input using "Import Mask", it will + overwrite the existing mask. It is important therefore that + the external pixel mask also excludes the detector gaps. + +After launching the dialog, the current mask can be plotted by clicking +on "Plot Mask." This overlays the mask on the powder diffraction data to +enable the center of the beam and other features of the data to be +identified. + +.. figure:: /images/create-mask.png + :align: center + :width: 80% + + *Create Mask dialog. The translucent red circle shows the circle + created by clicking "Add Shape".* + +By clicking on "Add Shape" with either a rectangle or circle selected, a +translucent shape is added to the plot. By default, it is centered on +the beam center, but may be moved by dragging the center of the shape +and/or resized by dragging one of the shape edges. When the shape has +the correct position and size, click on "Add Shape" again for the shape +to be added to the current list. A pull-down menu allows existing shapes +to be selected for removal if necessary. + +If a more complicated mask is required, it can be generated by an +external image editor and imported using "Import Mask". + +When the mask is complete, click "Save" to save it to the configuration file. + diff --git a/docs/source/images/create-mask.png b/docs/source/images/create-mask.png new file mode 100644 index 0000000..427c4f7 Binary files /dev/null and b/docs/source/images/create-mask.png differ diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index 1850357..d7260cd 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -124,9 +124,12 @@ where .. math:: - \mathbf{d}(x_{p}, y_{p})=\mathcal{D}\mathcal{O}^{-1}_{det} - \begin{pmatrix}{x_{p}-x_{c}}\\{y_{p}-y_{c}}\\0\end{pmatrix}-\mathcal{G} - \begin{pmatrix}{x_{s}-l_{sd}}\\{y_{s}}\\{z_{s}}\end{pmatrix} + \mathbf{d}(x_{p}, + y_{p})=\mathcal{D}\mathcal{O}^{-1}_{det} + \begin{pmatrix}{x_{p}-x_{c}}\\{y_{p}-y_{c}}\\0\end{pmatrix}- + \mathcal{G} + \begin{pmatrix}{x_{s}}\\{y_{s}}\\{z_{s}}\end{pmatrix}- + \begin{pmatrix}{l_{sd}}\\{0}\\{0}\end{pmatrix} The :math:`\mathcal{B}` matrix is defined by the lattice parameters of the sample, as described by Busing and Levy in Acta Cryst. **22**, 457