The MDSplus WebScope is a HTML5-based interface to MDSplus data presenting an interface quite similar to jScope on Web Browsers. This Web application is able to retrieve the jScope configuration files for a given user in the system hosting the web server and to display and manipulate (possibly multiple) waveforms and frame sequences. Most of the options available in jScope for user interaction are available in WebScope, too. Unlike jScope, WebScope does not allow users to define new configurations. Therefore it is necessary to use jScope for defining and saving the desired configurations (that is, defining the panels and the waveforms or images to be displayed in each panel) in the default configuration directory for jScope ($HOME/jScope/configurations). Observe that this work has to be done once and corresponds to the normal operation for MDSplus user who typically define first the jScope configurations they are interested in and then use the prepared ones.
When connecting to a Web server hosting MDSplus data, the start URL is the following
in response, the list of the available jScope configurations for the specified user will be displayed:
When clicking on any configuration, the corresponding set of panels will be displayed. If a shot number has not been specified in the corresponding jScope configuration (as normally happens) the panels will be empty and will be filled with waveforms when typing the shot number in the bottom Shot field:
Once the waveforms have been displayed it is possible to zoom, define and drag crosshairs and use the other jScope interaction mechanisms. A popup list is displayed when clicking the right mouse button over a panel, showing a set of useful graphical operations such as scaling all the waveforms in step with the selected one:
Frame sequences can be displayed with WebScope, as well, and by moving the crosshair over some reference waveform, the frame corresponding to the selected time is displayed:
Even if jScope has been tested with different browsers, it is recommended to use Chrome, while IE is discouraged.
On the server side, WebScope relies on modwsgi that is the Python WSGI adapter module for Apache. This adapter uses the python MDSplus interface to read data in pulse files and to export them to Web browsers. The rest of this tutorial will explain how installing and configuring wsgi for WebScope.
Web Server configuration for WebScope
In the following we shall assume a Linux system and the Apache Web server, which must be updated to version 2.2.x or higher.
In order to download and install the Python WSGI adapter module for Apache, it is recommended to go to the QuickInstallationGuide page and to follow the instructions for downloading and building WSGI.
Once installed, it is necessary to make sure that the python interface of MDSplus has been set up. Normally this is performed by the installation procedure. In case it can be performed via the following commands (with root privileges):
cd $MDSPLUS_DIR/mdsobjects/python python setup.py install
Once WSGI has been installed, the following steps are required:
- Create file mdsplus.wsgi in the directory hosting CGI files for Apache (normally /var/www/cgi-bin/) containing the following line:
from MDSplus.mdsplus_wsgi import application
- configure Apache by editing the Apache configuration file (normally /etc/httpd/conf/httpd.conf) and adding line
LoadModule wsgi_module modules/mod_wsgi.so
in the Dynamic Shared Object (DSO) Support section of the configuration file
WSGIScriptAlias /mdsplusWsgi /var/www/cgi-bin/mdsplus.wsgi
in the ScriptAlias section.
- Create file mdsplus_wsgi_config.py in the directory hosting CGI files for Apache (normally /var/www/cgi-bin/). This file will contain the environment variable definition for the WSGI module and will be something like:
import os os.environ['MDS_PATH']='usr/local/mdsplus/tdi' os.environ['exp_1_path']='/disk1/mdsplus' os.environ['exp_2_path']='/disk1/mdsplus' os.environ['exp_3_path']='/disk1/mdsplus'
the first line defines the environment variable MDS_PATH which must be set to the <mdsplus_distr>/tdi (normally /usr/local/mdsplus/tdi). The following lines define the location of the pulse files which will be used for waveform visualization. Recall that the environment variable <experiment name>_path must be defined so that MDSplus can locate the pulse file for the experiment.
Afterwards Apache must be restarted and the Web server is configured. The last step is to make sure that all the user jScope configuration files and directories are readable by the Web server project, e.g. giving the command
chmod -R a+rx /home/<user>/jScope