Skip to content

Commit 976bce5

Browse files
authored
Merge pull request #287 from European-XFEL/documentation
[DOC] Update documentation
2 parents e3fff48 + e964f2e commit 976bce5

File tree

6 files changed

+79
-25
lines changed

6 files changed

+79
-25
lines changed

Diff for: docs/image_tool.rst

+53-17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IMAGE TOOL
1111
The *ImageTool* window is the second control window which provides various image-related
1212
information and controls.
1313

14-
.. image:: images/ImageTool.png
14+
.. image:: images/image_tool.jpg
1515
:width: 800
1616

1717
Image control
@@ -26,13 +26,28 @@ Image control
2626
| ``Update automatically`` | Automatically update the current displayed image in the |
2727
| | *ImageTool* window. |
2828
+----------------------------+--------------------------------------------------------------------+
29+
| ``Moving average`` | Apply moving average to the image data. It affects both the |
30+
| | individual images in a train and the averaged image, as well as |
31+
| | the subsequent analysis. If a new window size is smaller than |
32+
| | the old one, the moving average calculation will start from the |
33+
| | scratch. |
34+
+----------------------------+--------------------------------------------------------------------+
2935
| ``Auto level`` | Update the detector images (not only in the *ImageTool* window, |
3036
| | but also in other plot windows) by automatically selecting levels |
3137
| | based on the maximum and minimum values in the data. |
3238
+----------------------------+--------------------------------------------------------------------+
3339
| ``Save image`` | Save the current image to file. Please also see ImageFileFormat_ |
3440
+----------------------------+--------------------------------------------------------------------+
3541

42+
.. Warning::
43+
44+
The moving average here is not calculated by nanmean_, which means that if a pixel of the image
45+
in a certain pulse is *NaN*, the moving average of that pixel will be *NaN* for that pulse.
46+
47+
.. Warning::
48+
49+
Please be aware that there is another moving average setup in the :ref:`Global setup` in the
50+
main GUI.
3651

3752
Mask panel
3853
""""""""""
@@ -173,6 +188,8 @@ Gain / offset
173188

174189
.. _nanmean: https://docs.scipy.org/doc/numpy/reference/generated/numpy.nanmean.html
175190

191+
.. image:: images/gain_offset_correction.jpg
192+
176193
Apply pixel-wised gain and offset correction, where
177194

178195
.. math::
@@ -183,26 +200,45 @@ Users can record a "dark run" whenever data is available. The dark run consists
183200
of trains. The moving average of the each "dark pulse" in the train will be calculated,
184201
which will then be used to apply dark subtraction to image data pulse-by-pulse.
185202

186-
+----------------------------+--------------------------------------------------------------------+
187-
| Input | Description |
188-
+============================+====================================================================+
189-
| ``Gain correction`` | Check to activate gain correction. |
190-
+----------------------------+--------------------------------------------------------------------+
191-
| ``Offset correction`` | Check to activate offset correction. |
192-
+----------------------------+--------------------------------------------------------------------+
193-
| ``Use dark as offset`` | Check to use recorded dark images as offset. The already loaded |
194-
| | offset constants will be ignored. |
195-
+----------------------------+--------------------------------------------------------------------+
196-
| ``Record dark`` | Start and stop dark run recording. |
197-
+----------------------------+--------------------------------------------------------------------+
198-
| ``Remove dark`` | Remove the recorded dark run. |
199-
+----------------------------+--------------------------------------------------------------------+
200-
201-
.. Note::
203+
+-----------------------------+--------------------------------------------------------------------+
204+
| Input | Description |
205+
+=============================+====================================================================+
206+
| ``Apply gain correction`` | Check to activate gain correction. |
207+
+-----------------------------+--------------------------------------------------------------------+
208+
| ``Apply offset correction`` | Check to activate offset correction. Since version 1.10, a |
209+
| | variation of offset correction has been introduced: |
210+
| | |
211+
| | - ``+intra-dark``: |
212+
| | |
213+
| | After the pulse-by-pulse offset correction, every other pulse |
214+
| | will be subtracted by the following one starting from the |
215+
| | first pulse. For instance, imaging a pulse train consisting of |
216+
| | four pulses *ABAB*, the extra intra-dark correction will |
217+
| | result in a train *A'BA'B*, where *A'* = *A* - *B*. |
218+
| | Then one can make use of the pulse slicer in the |
219+
| | :ref:`Data source tree` to remove the intra-dark pulses. |
220+
+-----------------------------+--------------------------------------------------------------------+
221+
| ``Use dark as offset`` | Check to use recorded dark images as offset. The already loaded |
222+
| | offset constants will be ignored. |
223+
+-----------------------------+--------------------------------------------------------------------+
224+
| ``Record dark`` | Start and stop dark run recording. |
225+
+-----------------------------+--------------------------------------------------------------------+
226+
| ``Remove dark`` | Remove the recorded dark run. |
227+
+-----------------------------+--------------------------------------------------------------------+
228+
229+
.. Warning::
202230

203231
The moving average here is not calculated by nanmean_, which means that if a pixel of the image
204232
in a certain pulse is *NaN*, the moving average of that pixel will be *NaN* for that pulse.
205233

234+
.. Note::
235+
236+
Some detectors have its own special treatment for gain/offset correction:
237+
238+
- DSSC:
239+
240+
Due to the readout issue, pixels with value 0 will be converted to 256.
241+
206242

207243
Reference image
208244
---------------

Diff for: docs/images/ImageTool.png

-157 KB
Binary file not shown.

Diff for: docs/images/gain_offset_correction.jpg

61.8 KB
Loading

Diff for: docs/images/image_tool.jpg

86.8 KB
Loading

Diff for: docs/installation.rst

+4-6
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ accelerate your analysis, please feel free to dig into the code and ask question
6666
# Now you should be able to load the newly created kernel on max-jhub.
6767
6868
69-
Install C++ API of **EXtra-foam** only
70-
--------------------------------------
69+
Install C++ API only
70+
--------------------
7171

72-
.. code-block:: bash
72+
.. _foamalgo: https://github.com/zhujun98/foamalgo
7373

74-
$ mkdir build && cd build
75-
$ cmake -DFOAM_USE_XSIMD=ON -DCMAKE_INSTALL_PREFIX=/YOUR/INSTALL/PREFIX
76-
$ make && make install
74+
Please check foamalgo_.

Diff for: docs/main_gui.rst

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
MAIN GUI
24
========
35

@@ -80,6 +82,8 @@ Namely, only one connection should be checked.
8082
| ``Port`` | Port number of the TCP connection. |
8183
+----------------------------+--------------------------------------------------------------------+
8284

85+
.. _Data source tree:
86+
8387
Data source tree
8488
""""""""""""""""
8589

@@ -137,6 +141,7 @@ online analysis in the hutch, or in the :ref:`File streamer` when you are stream
137141
General analysis
138142
----------------
139143

144+
.. _Global setup:
140145

141146
Global setup
142147
""""""""""""
@@ -154,14 +159,29 @@ Define analysis parameters used globally.
154159
+----------------------------+--------------------------------------------------------------------+
155160
| ``Moving average window`` | Moving average window size. If the moving average window size is |
156161
| | larger than 1, moving average will be applied to all the |
157-
| | registered analysis types. If the new window size is smaller than |
162+
| | registered analysis types. If a new window size is smaller than |
158163
| | the old one, the moving average calculation will start from the |
159-
| | scratch. |
164+
| | scratch. Currently, this setup will affect the calculations of: |
165+
| | |
166+
| | - Pulse intensity of XGM |
167+
| | - Pulse integral of Digitizer |
168+
| | - Train-resolved (pump/probe) azimuthal integration |
169+
| | - Train-resolved (pump/probe) ROI FOM |
170+
| | - Train-resolved (pump/probe) ROI 1D projection |
171+
| | |
160172
+----------------------------+--------------------------------------------------------------------+
161173
| ``Reset`` | Reset the moving average counts of all registered analysis types. |
162174
+----------------------------+--------------------------------------------------------------------+
163175

164176

177+
.. Warning::
178+
179+
Since version 1.10, another moving average was re-activated in :ref:`Image tool`. If both the
180+
moving averages are set, the result of azimuthal integration, ROI FOM and ROI 1D projection
181+
will be a moving average on top of the moving averaged image! This is due to some historical
182+
reason and it will be fixed in the future.
183+
184+
165185
Pump-probe setup
166186
""""""""""""""""
167187

0 commit comments

Comments
 (0)