test_mdsplus

PURPOSE ^

test access to MDS+ database

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

test access to MDS+ database

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %
0002 %test access to MDS+ database
0003 %
0004 clear all
0005 close all
0006 clc
0007 %
0008 % Direct access
0009 %
0010 %
0011 % JET Tokamak
0012 %
0013 mdsconnect('mdsplus.jet.efda.org');%JET
0014 shot = 84744;
0015 %
0016 [picrh,status] = mdsvalue(sprintf('_sig7=jet("ppf/ICRH/PTOT",%d)',shot));
0017 [ticrh,status] = mdsvalue('dim_of(_sig7)');  picrh=picrh/1e6;
0018 %
0019 mdsclose;
0020 mdsdisconnect;
0021 %
0022 figure, plot(ticrh,picrh)
0023 title('JET discharge #84744');
0024 xlabel('time (s)');ylabel('P_{icrh} (MW')
0025 %
0026 % EAST tokamak
0027 %
0028 mdsconnect('202.127.204.42');%EAST
0029 shot = 43326;
0030 %
0031 mdsopen('pcs_EAST',shot);
0032 %
0033 Ip = mdsvalue('\pcrl01'); % plasma current
0034 time = mdsvalue('dim_of(\pcrl01)'); 
0035 %
0036 mdsclose;
0037 mdsdisconnect;
0038 %
0039 figure, plot(time,Ip/1e6,'r-')
0040 title('EAST discharge #43326');
0041 xlabel('time (s)');ylabel('|I_p| (MA)')
0042 
0043 %
0044 % Remote access
0045 %
0046 % Alcator C-Mod (because PSFC database accessible from a local workstation
0047 % only). Use 'traverser' application in a terminal on a local workstation to get all
0048 % the tree structures (not the data). Type cmod, and -1 for the shot. Use
0049 % scope to see data locally. It can be done also in matlab on the
0050 % workstation,
0051 %
0052 % mdsopen('cmod',1160727011)
0053 % mdstcl
0054 % dir
0055 % set def .MHD
0056 % dir
0057 %... until \ANALYSIS::EFIT_GEQDSK
0058 %
0059 % the exit TCL mode and type   a = mdsvalue('\nameofdata') for the data and
0060 % t = mdsvalue(dim_of(\nameofdata,xx)') wiith xx= 1 or 2, or for the time.
0061 %
0062 sinputs.remote.profile = 'PSFC_CMODWS85';%
0063 sinputs.remote.profilename = NaN;%may be yves, joan, ypeysson or NaN
0064 sinputs.remote.link_mode = NaN;% use value from remote.link_mode
0065 sinputs.mdsplus.ipserver = 'alcdata.psfc.mit.edu';
0066 sinputs.mdsplus.shotnumber = '1160727001';
0067 sinputs.mdsplus.tree(1).name = 'magnetics';
0068 sinputs.mdsplus.tree(1).values = {'\ip','\btor'};
0069 sinputs.mdsplus.tree(1).units = {'A','T'};
0070 sinputs.mdsplus.tree(2).name = 'electrons';
0071 sinputs.mdsplus.tree(2).values = {'\top.tci.results:nl_04','\electrons::top.tci.results.inversion.nebar_efit','\gpc2_te0','\thom_midpln:te_t'};
0072 sinputs.mdsplus.tree(2).units = {'m^2','m^3','keV','keV'};
0073 sinputs.mdsplus.tree(3).name = 'analysis';
0074 sinputs.mdsplus.tree(3).values = {'\top.mflux:v0'};
0075 sinputs.mdsplus.tree(3).units = {'V'};
0076 sinputs.mdsplus.tree(4).name = 'LH';
0077 sinputs.mdsplus.tree(4).values = {'\top.hxr.results:'};
0078 sinputs.mdsplus.tree(4).units = {'V'};
0079 %
0080 % \ip -> plasma current (A)
0081 % \btor') -> toroidal magnetic field (T)
0082 % \top.tci.results:nl_04 -> line integrated density (m^-2), dividing nl_04 by 0.6 m for getting ne (the length of the chord integrated over).
0083 % \electrons::top.tci.results.inversion.nebar_efit -> line averaged electron density calculated from EFIT (m^-3)
0084 % \gpc2_te0 -> electron temperature on axis (keV) from ECE
0085 % \thom_midpln:te_t -> electron T on axis (keV) from Thomson scattering
0086 % \top.mflux:v0 -> loop voltage on axis (V)
0087 %
0088 soutputs = remotemdsplus(sinputs);
0089 %
0090 if isfield(soutputs,'err'),
0091     %
0092     disperr_jd(soutputs.err)
0093     %
0094 else
0095     %
0096     figure,plot(soutputs.mdsplus.tree(1).values(1).time,abs(soutputs.mdsplus.tree(1).values(1).data)/1e6);
0097     xlabel('time (s)');ylabel('|I_p| (MA)')
0098     title(['Alcator C-Mod discharge #',sinputs.mdsplus.shotnumber]);
0099     %
0100 end
0101 %

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.