Examples of using TDI expressions

Example 1. Reading an MDSplus "signal" and its time vector and units labels via IDL.

In this case the data comes from a Ufile "pointed to" via a TDI function in the node :SIGNAL . This data is accessed just as if it were actually stored in the tree node.

The TDI expression stored in the node is:

READ_UFILE($SHOT, "T", "CUR", "TR_DISK:", "BUDNY.TFTR")

The TDI function READ_UFILE is MDS$ROOT:[TDI]READ_UFILE.FUN, and can be examined as an example of coding TDI functions.

The "units" are 30-character Ufile labels giving both description and unit information. Typical units strings would be restricted to just units.

TDI instrinsic functions used below are dim_of and units_of.

IDL> mds$open,'transp',76778
% Compiled module: MDS$OPEN.
IDL> sig=mds$value('\transp::top.ufiles.cur:signal')
% Compiled module: MDS$VALUE.
% Compiled module: MDSPLUS.
% Compiled module: LINKIMAGE_ONCE.
NAMED FILE:  TR_DISK:[BUDNY.TFTR]T76778.CUR
% READING 1D COMPRESSED BINARY DATA WRITTEN 27-MAY-94
IDL> help,sig
SIG             FLOAT     = Array(16384)
IDL> time=mds$value('dim_of(\transp::top.ufiles.cur:signal)')
IDL> help,time
TIME            FLOAT     = Array(16384)
IDL> flab=mds$value('units_of(\transp::top.ufiles.cur:signal)')
IDL> print,flab
Plasma Current      Amps
IDL> tlab=mds$value('units_of(dim_of(\transp::top.ufiles.cur:signal))')
IDL> print,tlab
Time                Seconds
IDL>