load_EC_tsbase_yp

PURPOSE ^

SYNOPSIS ^

function [flag,EC_out] = load_EC_tsbase_yp(shotnum,certif,shotime,tmin,tmax,basestr);

DESCRIPTION ^

   Load processed experimental data (TFCE treatment) of the tokamak Tore
   Supra 

   by Y. Peysson (CEA/DSM/IRFM,yves.peysson@cea.fr) and J. Decker (CEA/DSM/IRFM,joan.decker@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function  [flag,EC_out] = load_EC_tsbase_yp(shotnum,certif,shotime,tmin,tmax,basestr);
0002 %
0003 %   Load processed experimental data (TFCE treatment) of the tokamak Tore
0004 %   Supra
0005 %
0006 %   by Y. Peysson (CEA/DSM/IRFM,yves.peysson@cea.fr) and J. Decker (CEA/DSM/IRFM,joan.decker@cea.fr)
0007 %
0008 method = 'spline';
0009 flag = 1;
0010 %
0011 if strcmp(basestr,'TS'),
0012     %
0013     shotnum = str2num(shotnum) + certif/10;  
0014     %
0015     % Load EC parameters from diagnostic directly (from J. F. Artaud for METIS)
0016     %
0017     [xika1,tbad] = tsbase(shotnum,'sika1');% gyrotron A1 cathode current
0018     [xHAUTTOR,tHAUTTOR] = tsbase(shotnum,'SHAUTTOR');% Toroidal injection angle top mirror (A1) hysteresis corrected
0019     if ~isempty(xika1) & ~isempty(xHAUTTOR)
0020         [prxA1,tA1] = tsbase(shotnum,'spia1');% gyrotron A1 power (anode current)
0021         [prxA2,tA2] = tsbase(shotnum,'spia2');% gyrotron A2 power (anode current)
0022         [sonde,tsonde] = tsbase(shotnum,'sonderf');% RF probe on reflectometer
0023         [xHAUTPOL,tHAUTPOL] = tsbase(shotnum,'SHAUTPOL');% Poloidal injection angle top mirror (A1) hysteresis corrected
0024         [xMILTOR,tMILTOR] = tsbase(shotnum,'SMILTOR');% Toroidal injection angle central mirror (A2) hysteresis corrected
0025         [xMILPOL,tMILPOL] = tsbase(shotnum,'SMILPOL');% Poloidal injection angle central mirror (A2) hysteresis corrected
0026         %
0027         % Powers in W (from M. Lennholm)
0028         %
0029         factA1 = 1;% Calibration factor to be applied to A1
0030         factA2 = 1;% Calibration factor to be applied to A2
0031         PA1 = max(0,1e6*prxA1/factA1);% A1 power in W
0032         PA2 = max(0,1e6*prxA2/factA2);% A2 power in W
0033         Ptot = PA1 + PA2;% total power (W)
0034         %
0035         % Mirror positions (m)
0036         %
0037         EC_out.RA2 = 3.5300;
0038         EC_out.RA1 = 3.5300;
0039         EC_out.ZA2 = 0;
0040         EC_out.ZA1 = 0.2000;
0041         %
0042         % Time averaging between tmin and tmax
0043         %
0044         PA1_tmin = interp_tprof_time_fxdrg(tA1,PA1,tmin,method);%Time interpolation
0045         PA1_tmax = interp_tprof_time_fxdrg(tA1,PA1,tmax,method);%Time interpolation
0046         dt_PA1 = [tmin;tA1(find((tA1 > tmin).*(tA1 < tmax)));tmax];
0047         EC_out.PA1 = mean([PA1_tmin;PA1(find((tA1 > tmin).*(tA1 < tmax)),:);PA1_tmax]);%Mean value
0048         %
0049         phiA1_tmin = interp_tprof_time_fxdrg(tHAUTTOR,xHAUTTOR,tmin,method);%Time interpolation
0050         phiA1_tmax = interp_tprof_time_fxdrg(tHAUTTOR,xHAUTTOR,tmax,method);%Time interpolation
0051         dt_phiA1 = [tmin;tHAUTTOR(find((tHAUTTOR > tmin).*(tHAUTTOR < tmax)));tmax];
0052         EC_out.phiA1 = mean([phiA1_tmin;xHAUTTOR(find((tHAUTTOR > tmin).*(tHAUTTOR < tmax)),:);phiA1_tmax]);%Mean value
0053         %
0054         thetaA1_tmin = interp_tprof_time_fxdrg(tHAUTPOL,xHAUTPOL,tmin,method);%Time interpolation
0055         thetaA1_tmax = interp_tprof_time_fxdrg(tHAUTPOL,xHAUTPOL,tmax,method);%Time interpolation
0056         dt_thetaA1 = [tmin;tHAUTPOL(find((tHAUTPOL > tmin).*(tHAUTPOL < tmax)));tmax];
0057         EC_out.thetaA1 = mean([thetaA1_tmin;xHAUTPOL(find((tHAUTPOL > tmin).*(tHAUTPOL < tmax)),:);thetaA1_tmax]);%Mean value
0058         %
0059         PA2_tmin = interp_tprof_time_fxdrg(tA2,PA2,tmin,method);%Time interpolation
0060         PA2_tmax = interp_tprof_time_fxdrg(tA2,PA2,tmax,method);%Time interpolation
0061         dt_PA2 = [tmin;tA2(find((tA2 > tmin).*(tA2 < tmax)));tmax];
0062         EC_out.PA2 = mean([PA2_tmin;PA2(find((tA2 > tmin).*(tA2 < tmax)),:);PA2_tmax]);%Mean value
0063         %
0064         phiA2_tmin = interp_tprof_time_fxdrg(tMILTOR,xMILTOR,tmin,method);%Time interpolation
0065         phiA2_tmax = interp_tprof_time_fxdrg(tMILTOR,xMILTOR,tmax,method);%Time interpolation
0066         dt_phiA2 = [tmin;tMILTOR(find((tMILTOR > tmin).*(tMILTOR < tmax)));tmax];
0067         EC_out.phiA2 = mean([phiA2_tmin;xMILTOR(find((tMILTOR > tmin).*(tMILTOR < tmax)),:);phiA2_tmax]);%Mean value
0068         %
0069         thetaA2_tmin = interp_tprof_time_fxdrg(tMILPOL,xMILPOL,tmin,method);%Time interpolation
0070         thetaA2_tmax = interp_tprof_time_fxdrg(tMILPOL,xMILPOL,tmax,method);%Time interpolation
0071         dt_thetaA2 = [tmin;tMILPOL(find((tMILPOL > tmin).*(tMILPOL < tmax)));tmax];
0072         EC_out.thetaA2 = mean([thetaA2_tmin;xMILPOL(find((tMILPOL > tmin).*(tMILPOL < tmax)),:);thetaA2_tmax]);%Mean value
0073     else
0074         EC_out.RA2 = 3.5300;
0075         EC_out.RA1 = 3.5300;
0076         EC_out.ZA2 = 0;
0077         EC_out.ZA1 = 0.2000;
0078         EC_out.PA1 = '';
0079         EC_out.phiA1 = '';
0080         EC_out.thetaA1 = '';
0081         EC_out.PA2 = '';
0082         EC_out.phiA2 = '';
0083         EC_out.thetaA2 = '';
0084         flag = 0;
0085     end
0086 else
0087     disp('Not yet implemented for this machine.')
0088     return
0089 end
0090

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