Lab window moments
This mechanism is used to setup diagnostic locations in the lab frame at fixed z locations. This will record moments from the particles as a function of time at the given locations in the lab frame. The variable top.itlabwn controls how often the diagnostic is calculated. A value of n means that at every nth time step, the moments are calculated. The recommended method of adding the diagnostic locations is using the function addlabwindow. This function can be called at any time.
This will add a diagnostic station at z = 3.1415 meters in the lab frame. After the simulation, to plot the Xrms as a function of time at that location, the following call can be made.
Below is a list of some of the function available for plotting the lab window moments. The whole list can be found in the python script lwplots.py, or printed using lwplotsdoc(). Each function accepts a number of arguments that can be used to control the plot. The documentation can be printed by, for example, doing doc(ppnumpw).
The diagnostic data generated can be accessed directly. This, for example, will get the Xrms data for species js.
Careful indexing is needed for the first dimension to avoid including unused array elements (which are filled with zeros). The full list of moments can be found in the group Lab_Moments in top.v.
An alternative method can be used to setup lab windows, but it is not recommended. It is only listed here since it can sometimes be seen in old input files. It is to directly set the array top.zlw. This snippet will setup a window similar to the above example.
Then, when calling the plot functions or accessing the arrays, 4 would be used instead of ilw_pi. This is not recommended since you would be required to allocate the space for the top.zlw array and you would have to handle the bookkeeping, keeping track of which window number refers to which location.