[an error occurred while processing this directive]

Table of Contents

Introduction

MDSplus provides a set of tools for performing data acquisition and analysis for pulsed experiments. It is designed to keep all experimental data, analysis results, experiment configuration and setup information together in an organized fashion. The data for each pulse of the experiment is stored in a hierarchical tree structure much like a file system. Each item of data (i.e. the data from a digitizer channel, a setup parameter, a comment) is stored in a node in the tree. This organization enables the users to keep track of large numbers of pieces of information. Currently the tree describing the Alcator C-MOD experiment has nearly 44,000 nodes containing information in over 1400 "directories". Each item of data can be any of several supported data types. These include elemental data types such as integer, floating point, text, or some more complex data types such as signals, devices, actions.

A tag is a shorthand name for the full tree path from the top of a tree to a given node. A node has just one name, but may have many different tags (tagnames). For example, the full path to the node which holds the HBT-EP plasma current data is \HBTEP::TOP.RESULTS.BASIC_PLASMA:PLASMA_CURR. This full path could be used to retrieve the data, timing and units. The tags for the same node are \IP or \PC. These tags could be used wherever the full path could be used.

Note: The examples given are specific to the hbtep database used on the HBT-EP tokamak but in most cases CTX will have an analogous setup.

MIT's official MDSPlus page: www.mdsplus.org or www.mdsplus.org/mdsplus/

The MDSPlus pages from General Atomics and PPPL are often just as informative.


MDSPlus Setup

Read Access?

All cua900 users should be able to access the hbtep tree and data.
You can check to see if the logical hbtep$data is properly defined with this command
$ show logical hbtep$data
it should have a system wide definition which points to the correct data directories.

Write Access

In order to modify the hbtep tree you will have to have the privilege to write to hbtep$data directories To check your acl id in vms type
$ show process /privelege
you should see under the heading process rights:

username	resource
interactive
local
hbtep_data	resource 

if you do not have rights to hbtep_data as a resource then a system administrator will need to grant this id to your account.
 
When trying to edit a tree without sufficient privileges, you may see the message:
$ mcr traverser -tree hbtep -shot -1 -edit
Tree /hbtep/ shot /-1/ does not exist.  Create?(Y/N) n

If the tree does in fact already exist, the problem is likely to be that you are not privileged to edit it (add or delete nodes). This is usually a VMS file protection issue. You probably need to be granted an ACL identifier for this tree.

Additional Setup for machine operation:

If you will be an experimental operator (taking new data) you need to add the line
@dka100:[hbtep]setup_hbtep
to your login.com file so that common symbols and logicals will be properly defined - Here is a list of everything defined in the setup script:

$! Define a few logical directories
$ define hbtep$root dka100:[hbtep]
$ define mds$log dka100:[hbtep.logfiles]+mds$root:[syserr]
$ define hbtep$anl dka100:[hbtep.analysis]
$!
$! turns crates on and shows crate status
$ crates_on == "@hbtep$root:crates_on.com"
$!
$! defines a symbol to start the MDS action monitor
$ actmon == "spawn /nowait mcr actmon -monitor hbtep_monitor"
$!
$! defines a symbol to start shot cycle dialog
$ start_cycle == "spawn /nowait @hbtep$root:start_cycle.com
$!
$!
$! go can be used for initial shot startup
$! it sequentially does actmon, start_cycle, and crates_on
$ go == "@hbtep$root:go.com"
$!
$! define a short cut to reset the current shot number
$! example: $ set_shot 10000
$ set_shot == "tcl @hbtep$root:set_shot.tcl"
$!
$! ----------
$! This script moves data from the dka100:[hbtep.data] directory
$! to the arc900:[hbtep.data] directory
$! input parameter is a shot number with wild cards
$! example: $ archive_data 304%%
$ archive_data == "@hbtep$root:archive_data.com"
$!
$! -----------
$! Some shortcuts for looking at log files
$ camac_log == "epyt mds$log:cua900_camac_server.log"
$ submit_log == "epyt mds$log:cua900_submit_server.log"
$ analysis_log == "type mds$log:compile_anl.log;"
$ anl_log == "type mds$log:compile_anl.log;"

Viewing Data

Viewing the Tree Structure

In order to open a tree you will need to specify the name of the tree (hbtep) and the shot number. There are two special shot numbers :

The tree for each shot can be different, and each time a shot is taken, the model shot is copied to the new shot number and then the tree for that shot is filled with data. So for changes which are general and will effect future shots, change the model shot. For changes specific to a given shot already exisitng, only change that shot's tree.

opening for edit
if you will be adding, or deleting nodes or tag names in a tree you will need to open the tree for edit
all other activities, including changing values of existing nodes can and should be done without opening the tree for edit
(only one person can have the tree open for edit at a time)

There are two ways to view a tree:

TCL has online help available
$ TCL
TCL> help

Additional TCL Examples from GA or NSTX

to open the traverser you can type:
$ mcr traverser -tree hbtep -shot -1

you can also add the traverser (and other MDSPlus applications) to your decwindows menubar through the options menu

The traverser has online help available from the Traverser menu bar
Here are a few additional links which have explanations of some of the Traverser’s features and how to use the Traverser properly.

http://nstx.pppl.gov/nstx/Software/TRAVERSER.html
http://nstx.pppl.gov/nstx/Software/pdf_files/MDSplusTrainingDoc2-2-99.pdf

How do I view data that is in the tree with Scope?

The built-in MdsPlus Scope can be used to view data.
Start scope from the command line:
$ mcr dwscope -default [hbtep]:banks.dat
(the scope setup file is optional)

There is also a Scope Pad available which is a utility used for convenient cut and paste of signal names and views into a scope session.
$mcr dwpad

Also the Scope and scope pad can be added to the decwindows menubar through the options menu

Scope and the Scope Pad have online help available ($help @mdsplus ).
Here are some links which have further explanations of Scope’s features.

http://nstx.pppl.gov/nstx/Software/SCOPE.html
http://nstx.pppl.gov/nstx/Software/pdf_files/scope_nstx_feb99.pdf

How do I view data that is in the tree with IDL?

You can also use IDL to view data using mdsopen and mdsvalue procedures
$IDL
IDL>mdsopen,’hbtep’,22763
IDL>y= mdsvalue(‘\vfc’)
IDL>time=mdsvalue(‘dim_of(\vfc)’)
IDL>plot, time, y
IDL>mdsclose


A full list of MDSPlus IDL procedures is also available.

Using the Tree Data Interface (TDI) Shared library


The TDISHR library is used to interact with data in an MDSPlus tree. When using the Traverser or Scope TDI is used to evaluate an expression, so TDI functions can be used as well as basic signal node names. A common TDI function you will need to use is dim_of – this function returns the x-axis associated with a signal – usually the timebase as demonstrated above in the IDL example. The IDL procedure mdsvalue is just a call to evaluate the TDI expression passed as the input string.

There are a lot of intrinsic functions and physical constants in the TDI Shared library which allow data manipulation and processing.

There is help for the TDISHR library ($help @mdsplus tdishr)

Princeton also has a useful html help page for the TDISHR library which lists information about each intrinsic function.

How do I make additions to an MDSPlus tree?


Adding a device to the Camac Branch of the tree


First a logical name must be defined for the digitizer which maps the logical name to the physical CAMAC hardware address.
This is done in CTS: for example a module added to Crate 3, Slot 12
$CTS
CTS> assign GKB103:N12 srm_j221_1 /comment=”Screenroom Jorway Trigger”
CTS> show srm_*


Now open the tree for edit and add the node to the appropriate branch.
Select the parent node of the device
Add the device type and give it an appropriate MDSPlus name
Make sure the Name node of the device is the same as the logical name defined in CTS.
Note: the camac name and MDSPlus node name are not necessarily the same.

Some common camac devices have additional information available on the web:


Adding Triggers Nodes

For most triggers it is not very convenient to change the trigger values in the j221 module directly, so a secondary node is defined which makes the trigger easier to use.
put a numeric node in camac.timing
define a unique tag name if this will be referenced often or changed by an external program
For the j221 channel being used for triggering put in the expression \tag_name – j221:start_trig
You can define the numeric node as a scalar num1 or a vector [num1,num2] (make sure that the expression is not in quotes, also make sure that the type of signal is correctly set on trigger or gate (or maybe computed, not sure how to use that yet)) this number is in microseconds relative to t=0 and the value can be anything > start_trig (usually –125 ms)

Defining Signals in the results branch of the tree:
Put a signal node in the proper branch of the tree and then define a unique tag name
If the signal is calculated using a digitizer channel, make a child signal node called raw and have that point to the proper digitizer channel (raw should be the only thing pointing directly to a hardware device, so that if the hardware changes it only needs to be changed in one place).

Analysis codes should refer to tag names rather than hardware names for the same reason.

Define a text child node named label which is a reasonable label for the signal to be used when printing or plotting the signal

Use SI units, all added signals should have appropriate units

Signal manipulation

Simple manipulation of signals can be done using the built in tdishr library of functions

The TDISHR library is used to interact with data in an MDSPlus tree. When using the Traverser or Scope TDI is used to evaluate an expression, so TDI functions can be used as well as basic signal node names. A common TDI function you will need to use is dim_of – this function returns the x-axis associated with a signal – usually the timebase as demonstrated above in the IDL example. The IDL procedure mdsvalue is just a call to evaluate the TDI expression passed as the input string.

There are a lot of intrinsic functions and physical constants in the TDI Shared library which allow data manipulation and processing.

There is help for the TDISHR library ($help @mdsplus tdishr)

Princeton also has a useful html help page for the TDISHR library which lists information about each intrinsic function.

For more complicated analysis you should submit an idl analysis procedure
Use an existing IDL analysis submission such as the OHC integration in the hbtep tree as an example.
MDSPlus has several IDL procedures built-in for manipulating data.

Setting Up MDSPlus Clients

You can download and install MDSPlus for your local workstation or desktop and access data from Columbia’s MDS Server (cua900.ap.columbia.edu).

After properly installing MDSPlus for your platform, you can run Scope, IDL, MATLAB, or Labview on your local computer to view, analyze or process data from a tree on cua900.

You may need a system administrator to modify the cua900::sys$common:[sysmgr]mdsip.hosts file so that your remote node is properly mapped to a user on cua900 (especially if you plan on writing to the tree).

If using IDL you will need to add the \MDSPlus\IDL directory to your path and use the command
IDL>mdsconnect,’cua900.ap.columbia.edu’
Before you  can access data (also use mdsdisconnect)

If using Matlab you need to add the \MDSPlus and \MDSPlus\Matlab directories to your path and use the command
>>mdsopen(‘cua900.ap.columbia.edu::’)
before accessing data (also use mdsdisconnect)

You can add cua900.ap.columbia.edu to the server list in the network menu of the Scope and otherwise use the scope normally to view data.