Skip to content

Commit b4d4240

Browse files
committed
clarify training
1 parent 5db64a9 commit b4d4240

File tree

2 files changed

+77
-33
lines changed

2 files changed

+77
-33
lines changed

docs/source/derived.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ These computations may involve mathematical expressions or NumPy functions.
99
Whenever a source waveform is changed, any waveform that depends on it is automatically
1010
recalculated in the GUI.
1111

12+
.. important::
13+
14+
The examples in this section show the full :ref:`YAML configuration files <yaml_format>`.
15+
If you are using the :ref:`GUI <gui>` to edit waveforms, you must only enter
16+
the waveform tendencies, and not enter any group or waveform names.
17+
For example, with the base waveform called ``base_waveform``, you can enter in the editor:
18+
19+
.. code-block:: yaml
20+
21+
- {type: linear, from: 5, to: 10, duration: 10}
22+
23+
Then, for the derived waveform, you enter:
24+
25+
.. code-block:: yaml
26+
27+
2 * "base_waveform"
28+
1229
Examples
1330
========
1431

@@ -66,12 +83,6 @@ The other waveforms are derived from ``test/1`` and apply different mathematical
6683
:width: 600px
6784
:align: center
6885

69-
.. note::
70-
71-
If you are using the Waveform Editor from the GUI, you only have to enter the
72-
expression in the block string. For the example above, you would only need
73-
to enter ``'test/1' + 10`` as the waveform definition for the waveform ``test/4``.
74-
7586
Multiple Dependencies
7687
---------------------
7788

docs/source/training/training.rst

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
Training Courses
44
================
55

6+
In this training you will learn the following:
7+
8+
- Creating and editing waveforms using the GUI
9+
- Exporting waveforms to an IDS
10+
11+
Exporting waveform configurations to IMAS HDF5 files
612
All examples assume you have an environment with the Waveform Editor up and running.
713
if you do not have this yet, please have a look at the :ref:`installation instructions <installing>`.
14+
You do not need to have installed the dependencies for the Plasma Shape Editor to do these exercises.
815

916
Creating your first waveforms
1017
-----------------------------
@@ -18,25 +25,37 @@ Exercise 1a: Creating a new waveform
1825
.. md-tab-item:: Exercise
1926

2027
In order to start editing waveforms, you must first learn how to navigate your way around
21-
around the GUI. Launch the waveform editor GUI. A waveform must *always* belong to a group,
22-
so create a new group, and create a new waveform inside it.
28+
around the GUI. Launch the Waveform Editor GUI using the following command,
29+
which opens the Waveform Editor in your default browser.
2330

24-
.. hint::
25-
Detailed instructions on how to edit the waveform configuration can be found :ref:`here <edit_config>`.
31+
.. code-block:: bash
2632
27-
.. md-tab-item:: Solution
33+
waveform-editor gui
2834
29-
#. Launch the Waveform Editor GUI using the following command, which opens the Waveform Editor
30-
in your default browser.
3135
32-
.. code-block:: bash
36+
#. A waveform must *always* belong to a group, so first create a group in which
37+
to store the new waveform, and provide a name for the group, e.g. ``Group1``.
38+
#. Create a new waveform in the previously created group, and provide a name for
39+
this waveform, e.g. ``Waveform1``.
40+
41+
What do you see in the sidebar on the left?
3342

34-
waveform-editor gui
43+
.. hint::
44+
Detailed instructions on how to add groups and waveforms from the GUI
45+
can be found :ref:`here <edit_config>`.
3546

36-
#. Create a group in which to store the new waveform, and provide a name for the group, e.g. ``Group1``.
37-
#. Create a new waveform in the previously created group, and provide a name for this waveform, e.g. ``Waveform1``.
3847

39-
You have now created a new, empty waveform, which is shown in the sidebar:
48+
.. md-tab-item:: Solution
49+
50+
.. |add_waveform_icon| image:: ../images/gui/add_waveform_icon.png
51+
:height: 24px
52+
.. |add_group_icon| image:: ../images/gui/add_group_icon.png
53+
:height: 24px
54+
55+
#. Use this button |add_group_icon| to add a new group and call it ``Group1``
56+
#. Use this button |add_waveform_icon| to add a new waveform and call it ``Waveform1``
57+
58+
You have now created a new waveform, which is shown in the sidebar:
4059

4160
.. image:: ../images/training/ex1_sidebar.png
4261
:align: center
@@ -48,15 +67,28 @@ Exercise 1b: Creating a sine wave
4867
.. md-tab-set::
4968
.. md-tab-item:: Exercise
5069

70+
Now you will edit the empty waveform you created in the previous exercise.
71+
Select the waveform in the sidebar and open the *Edit Waveforms* tab. You will
72+
see an editor window as well as a live view the waveform currently being edited.
73+
74+
The editor currently shows ``- {}``, indicating an empty tendency.
75+
A tendency can be specified by providing a tendency type and by setting parameters defining
76+
the shape of this tendency. For example:
77+
78+
.. code-block:: yaml
79+
80+
- {type: <waveform type>, <param 1>: <value 1>, <param 2>: <value 2>, ...}
81+
5182
Edit the waveform you created in the previous exercise such that it contains
52-
a single sine-wave tendency, with the following properties:
83+
a single sine-wave tendency, with the following parameters:
5384

85+
- Type: sine
5486
- Duration: from 10 to 15 seconds
5587
- Frequency: 0.5 Hz
5688
- Amplitude: 3
5789
- Vertical range: 0 to 6
5890

59-
Use the following tendency attributes: ``type``, ``start``, ``end``, ``frequency``, ``amplitude``, and ``base``.
91+
Use the following tendency parameters: ``type``, ``start``, ``end``, ``frequency``, ``amplitude``, and ``base``.
6092

6193
.. hint::
6294
Detailed descriptions of the tendencies can be found :ref:`here <available-tendencies>`.
@@ -81,7 +113,7 @@ Exercise 1c: Creating a sine wave - part 2
81113
.. md-tab-item:: Exercise
82114

83115
In the previous execise, you might have noticed that there a multiple ways in which you can define the same
84-
waveform. Recreate the waveform of previous exercise using only the following tendency attributes:
116+
waveform. Recreate the waveform of previous exercise using only the following tendency parameters:
85117
``type``, ``start``, ``duration``, ``period``, ``min``, and ``max``.
86118

87119
.. md-tab-item:: Solution
@@ -177,7 +209,7 @@ Exercise 2b: Shortform notation
177209

178210
Some examples:
179211

180-
#. If no ``start`` attribute is provided, the end of the previously tendency will be
212+
#. If no ``start`` parameter is provided, the end of the previously tendency will be
181213
used as a start value, or 0 if it is the first tendency.
182214
#. If no tendency ``type`` is provided, it will be considered a linear tendency by default.
183215
#. If no start value e.g. ``from`` is provided, it will try to match end of previous tendency.
@@ -190,10 +222,10 @@ Exercise 2b: Shortform notation
190222

191223
#. The first tendency - No ``start`` or ``from`` is needed because it begins at 0 by default.
192224
#. The second tendency - No ``type`` is provided, so it is a linear tendency by default.
193-
The ``start``, ``from``, and ``to`` attributes are by default set to the respective
225+
The ``start``, ``from``, and ``to`` parameters are by default set to the respective
194226
values at the end of the previous tendency.
195-
#. The third tendency - Again, the ``start`` and ``from`` attributes are inferred from the
196-
previous tendency. In this case, we do need to specify the ``to`` attribute, otherwise
227+
#. The third tendency - Again, the ``start`` and ``from`` parameters are inferred from the
228+
previous tendency. In this case, we do need to specify the ``to`` parameter, otherwise
197229
we would get a straight line.
198230

199231
.. code-block:: yaml
@@ -268,7 +300,7 @@ Exercise 3c: Repeating Waveforms
268300
.. md-tab-item:: Exercise
269301

270302
You can create repeating patterns using the ``repeat`` tendency. The repeat tendency
271-
allows you to specify the ``waveform`` attribute. This allows you to repeat
303+
allows you to specify the ``waveform`` parameter. This allows you to repeat
272304
any number of tendencies.
273305

274306
Take the waveform from the previous exercise and make it repeat three times.
@@ -279,7 +311,7 @@ Exercise 3c: Repeating Waveforms
279311

280312
A smooth tendency was added as a last tendency to smoothly transition from the
281313
linear tendency back into the piecewise linear tendency. This whole waveform is
282-
placed in the ``waveform`` attribute of the repeat tendency. Since the tendencies
314+
placed in the ``waveform`` parameter of the repeat tendency. Since the tendencies
283315
combine up to a total length of 11 (6+1+3+1), the total ``duration`` of the repeat
284316
tendency is set to 33, to obtain three full cycles.
285317

@@ -370,13 +402,13 @@ Exercise 4b: Derived Waveforms - part 2
370402
371403
where:
372404

373-
- :math:`P_0` = 16.5×10⁶ W (nominal power per beam box)
374-
- :math:`E_0` = 870×10³ eV (reference beam energy for hydrogen)
405+
- :math:`P_0` = 16.5e6 W (nominal power per beam box)
406+
- :math:`E_0` = 870e3 eV (reference beam energy for hydrogen)
375407
- :math:`E_\mathrm{beam}` is the beam energy
376408

377409
Define the following waveforms:
378410

379-
1. ``nbi/unit(1)/energy/data`` - linear ramps up from 0 to 500 keV, for 100 seconds, then flattops for 500 seconds, and then linearly ramps down for 100 seconds.
411+
1. ``nbi/unit(1)/energy/data`` - linear ramps up from 0 to 500e3, for 100 seconds, then flattops for 500 seconds, and then linearly ramps down for 100 seconds.
380412
2. ``nbi/unit(1)/power_launched/data`` - derived from the energy using the above equation.
381413

382414
.. md-tab-item:: Solution
@@ -417,11 +449,12 @@ Exercise 5a: Exporting from the UI
417449
at the instructions :ref:`here <gui>`.
418450

419451
We will export our EC beam power values to an ec_launchers IDS. Export the configuration
420-
to an HDF5 file. Sample the time such that there are 20 points in the range from 0 to 800.
452+
to an HDF5 file. Sample the time such that there are 20 points in the range from 0 to 800s.
421453

422454
Inspect the exported IDS using ``imas print <your URI> ec_launchers``, which
423-
quantities are filled? What happens with the values outside of the waveform range
424-
(time steps later than 700 s)?
455+
quantities are filled? Notice that the waveform in the configuration runs from 0 to 700s,
456+
while you export from 0 to 800s . What happens with the exported values outside
457+
of the waveform (time steps later than 700 s)?
425458

426459
.. hint::
427460
Detailed instructions on how to export the waveform configuration can be found :ref:`here <export_config>`.

0 commit comments

Comments
 (0)