0001 function proc_TS(shotnum,t0,tscan,p_opt)
0002
0003 if nargin < 4,
0004 p_opt = -1;
0005 end
0006
0007 if strcmp(shotnum,'40816'),
0008 cronos_file = 'zineb40816ts2de35a27850_resultat.mat';
0009 luke_file = 'LUKE_DATA_TS_40816_14.9000_C3PO_Coupleur_C1_C3PO_Coupleur_C2_OHM_RIPPLE.mat';
0010 elseif strcmp(shotnum,'41125'),
0011 cronos_file = 'base/zineb41125ts0de38a21687_resultat.mat';
0012 luke_file = 'LUKE_DATA_TS_41125_18.9000_C3PO_Coupleur_C1_OHM_RIPPLE.mat';
0013 elseif strcmp(shotnum,'43107'),
0014 cronos_file = 'zineb43107ts2_optimised_2_resultat.mat';
0015 if t0 == 11.5427,
0016 luke_file = 'LUKE_DATA_TS_43107_11.5427_C3PO_Coupleur_C1_C3PO_Coupleur_C2_OHM_RIPPLE.mat';
0017 elseif t0 == 13.6225,
0018 luke_file = 'LUKE_DATA_TS_43107_13.6225_C3PO_Coupleur_C1_C3PO_Coupleur_C2_OHM_RIPPLE.mat';
0019 elseif t0 == 15.0178,
0020 luke_file = 'LUKE_DATA_TS_43107_15.0178_C3PO_Coupleur_C1_C3PO_Coupleur_C2_OHM_RIPPLE.mat';
0021 else
0022 error('No LUKE run for this time')
0023 end
0024 end
0025
0026 cronos_path = '~/zineb/data/TS/';
0027
0028 cronos_filename = [cronos_path,shotnum,'/',cronos_file];
0029
0030 luke_filename = [shotnum,'/',luke_file];
0031
0032 data_cronos = load(cronos_filename);
0033 data_luke = load(luke_filename);
0034
0035 t = data_cronos.data.gene.temps;
0036 dt = diff(t);
0037 th = (t(1:end-1) + t(2:end))/2;
0038 nt = length(t);
0039
0040 rho = data_cronos.param.gene.x;
0041
0042 Te = data_cronos.data.prof.te/1000;
0043 q = data_cronos.data.prof.q;
0044 qeq = data_cronos.data.equi.q;
0045
0046 j_ohm = data_cronos.data.prof.jmoy - data_cronos.data.neo.jboot - data_cronos.data.source.hyb.j;
0047 j_hyb = data_cronos.data.source.hyb.j;
0048
0049 rho_luke = data_luke.output.equilDKE.xrhoT;
0050 j_luke = data_luke.output.Zcurr.x_0_vcfsav*data_luke.output.mksa.j_ref;
0051
0052 q0 = q(:,1);
0053 q0eq = qeq(:,1);
0054
0055 qmin = min(q,[],2);
0056 qeqmin = min(qeq,[],2);
0057
0058 rho1 = NaN(nt,5);
0059 rhoeq1 = NaN(nt,5);
0060
0061 for it = 1:nt,
0062 irho = find((q(it,2:end) - 1).*(q(it,1:end-1) - 1) <= 0);
0063 rho1(it,1:length(irho)) = (rho(irho).*abs(q(it,irho + 1) - 1) + rho(irho + 1).*abs(q(it,irho) - 1))./abs(q(it,irho + 1) - q(it,irho));
0064
0065 irhoeq = find((qeq(it,2:end) - 1).*(qeq(it,1:end-1) - 1) <= 0);
0066 rhoeq1(it,1:length(irhoeq)) = (rho(irhoeq).*abs(qeq(it,irhoeq + 1) - 1) + rho(irhoeq + 1).*abs(qeq(it,irhoeq) - 1))./abs(qeq(it,irhoeq + 1) - qeq(it,irhoeq));
0067 end
0068
0069 if nargin < 3,
0070 tscan = [t(1),t(end)];
0071 end
0072
0073 if nargin < 2,
0074 t0 = (t(1) + t(end))/2;
0075 end
0076
0077 mask = t >=tscan(1) & t <= tscan(2);
0078 it0 = find(t > t0,1,'first');
0079
0080 style0 = 'none';
0081 style = '-';
0082 style2 = '--';
0083 marker = 'none';
0084 marker1 = '+';
0085 marker2 = 'o';
0086 marker3 = 's';
0087 marker4 = '.';
0088 markers = {marker1,marker2,marker3};
0089 color = NaN;
0090 color1 = 'k';
0091 color2 = 'r';
0092 color3 = 'b';
0093 color4 = 'g';
0094 color5 = 'm';
0095 color6 = 'c';
0096 colors = {color2,color3,color4};
0097
0098 width = 0.5;
0099 width2 = 2;
0100 siz = 20+14*1i;
0101
0102 red = 0.9;
0103 lspace = 0.7;
0104 lspace2 = 0.5;
0105 bspace = 0.7;
0106 bspace2 = 0.5;
0107
0108
0109 figure(1),clf,set(1,'name','time steps')
0110
0111 x = th;
0112 xlab = 't (s)';
0113 xlim = NaN;
0114 y = dt*1000;
0115 ylab = '\Delta t (ms)';
0116 tit = shotnum;
0117 ylim = NaN;
0118
0119 graph1D_jd(x,y,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color2,width2,siz,gca,red,lspace,bspace2);
0120
0121 print_jd(p_opt,['Fig_',shotnum,'_dt'],[shotnum,'/figures'],1);
0122
0123
0124 figure(2),clf,set(2,'name','Te0')
0125
0126 x = t;
0127 xlab = 't (s)';
0128 xlim = NaN;
0129 y = Te(:,1);
0130 ylab = 'T_{e0} (keV)';
0131 tit = shotnum;
0132 ylim = NaN;
0133
0134 graph1D_jd(x,y,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color2,width2,siz,gca,red,lspace,bspace2);
0135
0136 print_jd(p_opt,['Fig_',shotnum,'_te0'],[shotnum,'/figures'],2);
0137
0138
0139 figure(3),clf,set(3,'name','Te0 zoom')
0140
0141 x = t(mask);
0142 xlab = 't (s)';
0143 xlim = NaN;
0144 y = Te(mask,1);
0145 ylab = 'T_{e0} (keV)';
0146 tit = shotnum;
0147 ylim = NaN;
0148
0149 graph1D_jd(x,y,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker,color2,width2,siz,gca,red,lspace,bspace2);
0150
0151 print_jd(p_opt,['Fig_',shotnum,'_te0_zoom'],[shotnum,'/figures'],3);
0152
0153
0154 figure(4),clf,set(4,'name','q')
0155
0156 x = rho;
0157 xlab = '\rho_T';
0158 xlim = NaN;
0159 y = [q(it0,:).',qeq(it0,:).'];
0160 ylab = 'q';
0161 tit = shotnum;
0162 ylim = NaN;
0163 leg = {'prof','equi'};
0164
0165 graph1D_jd(x,y,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color,width2,siz,gca,red,lspace,bspace2);
0166
0167 print_jd(p_opt,['Fig_',shotnum,'_q'],[shotnum,'/figures'],4);
0168
0169
0170 figure(5),clf,set(5,'name','q0')
0171
0172 x = t;
0173 xlab = 't (s)';
0174 xlim = NaN;
0175 y = [q0,q0eq];
0176 ylab = 'q_0';
0177 tit = shotnum;
0178 ylim = NaN;
0179 leg = {'prof','equi'};
0180
0181 graph1D_jd(x,y,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color,width2,siz,gca,red,lspace,bspace2);
0182
0183 print_jd(p_opt,['Fig_',shotnum,'_q0'],[shotnum,'/figures'],5);
0184
0185
0186 figure(6),clf,set(6,'name','q0 Zoom')
0187
0188 x = t(mask);
0189 xlab = 't (s)';
0190 xlim = NaN;
0191 y = [q0(mask),q0eq(mask)];
0192 ylab = 'q_0';
0193 tit = shotnum;
0194 ylim = NaN;
0195 leg = {'prof','equi'};
0196
0197 graph1D_jd(x,y,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color,width2,siz,gca,red,lspace,bspace2);
0198
0199 print_jd(p_opt,['Fig_',shotnum,'_q0_zoom'],[shotnum,'/figures'],6);
0200
0201
0202 figure(7),clf,set(7,'name','qmin')
0203
0204 x = t;
0205 xlab = 't (s)';
0206 xlim = NaN;
0207 y = [qmin,qeqmin];
0208 ylab = 'q_{min}';
0209 tit = shotnum;
0210 ylim = NaN;
0211 leg = {'prof','equi'};
0212
0213 graph1D_jd(x,y,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color,width2,siz,gca,red,lspace,bspace2);
0214
0215 print_jd(p_opt,['Fig_',shotnum,'_qmin'],[shotnum,'/figures'],7);
0216
0217
0218 figure(8),clf,set(8,'name','qmin Zoom')
0219
0220 x = t(mask);
0221 xlab = 't (s)';
0222 xlim = NaN;
0223 y = [qeqmin(mask),qmin(mask)];
0224 ylab = 'q_{min}';
0225 tit = shotnum;
0226 ylim = NaN;
0227 leg = {'prof','equi'};
0228
0229 graph1D_jd(x,y,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color,width2,siz,gca,red,lspace,bspace2);
0230
0231 print_jd(p_opt,['Fig_',shotnum,'_qmin_zoom'],[shotnum,'/figures'],8);
0232
0233
0234 figure(9),clf,set(9,'name','rho1')
0235
0236 x = t;
0237 xlab = 't (s)';
0238 xlim = NaN;
0239 y1 = rho1;
0240 y2 = rhoeq1;
0241 ylab = 'rho_1';
0242 tit = shotnum;
0243 ylim = NaN;
0244 leg = {'prof','equi'};
0245
0246 graph1D_jd(x,y1(:,1),0,0,xlab,ylab,tit,NaN,xlim,ylim,style0,marker1,color2,width2,siz,gca,red,lspace,bspace2);
0247 graph1D_jd(x,y2(:,1),0,0,'','','',leg,xlim,ylim,style0,marker2,color3,width2,siz);
0248
0249 graph1D_jd(x,y1(:,2:end),0,0,xlab,ylab,tit,NaN,xlim,ylim,style0,marker1,color2,width2,siz);
0250 graph1D_jd(x,y2(:,2:end),0,0,'','','',NaN,xlim,ylim,style0,marker2,color3,width2,siz);
0251
0252 print_jd(p_opt,['Fig_',shotnum,'_rho1'],[shotnum,'/figures'],9);
0253
0254
0255 figure(10),clf,set(10,'name','rho1 Zoom')
0256
0257 x = t(mask);
0258 xlab = 't (s)';
0259 xlim = NaN;
0260 y1 = rho1(mask,:);
0261 y2 = rhoeq1(mask,:);
0262 ylab = 'rho_1';
0263 tit = shotnum;
0264 ylim = NaN;
0265 leg = {'prof','equi'};
0266
0267 graph1D_jd(x,y1(:,1),0,0,xlab,ylab,tit,NaN,xlim,ylim,style0,marker1,color2,width2,siz,gca,red,lspace,bspace2);
0268 graph1D_jd(x,y2(:,1),0,0,'','','',leg,xlim,ylim,style0,marker2,color3,width2,siz);
0269
0270 graph1D_jd(x,y1(:,2:end),0,0,xlab,ylab,tit,NaN,xlim,ylim,style0,marker1,color2,width2,siz);
0271 graph1D_jd(x,y2(:,2:end),0,0,'','','',NaN,xlim,ylim,style0,marker2,color3,width2,siz);
0272
0273 print_jd(p_opt,['Fig_',shotnum,'_rho1_zoom'],[shotnum,'/figures'],10);
0274
0275
0276 figure(11),clf,set(11,'name','j')
0277
0278 x1 = rho;
0279 x2 = rho;
0280 x3 = rho_luke;
0281 xlab = '\rho_T';
0282 xlim = NaN;
0283 y1 = j_ohm(it0,:)/1e6;
0284 y2 = j_hyb(it0,:)/1e6;
0285 y3 = j_luke;
0286 ylab = 'J (MA/m^2)';
0287 tit = shotnum;
0288 ylim = NaN;
0289 leg = {'OHM','LH','LUKE'};
0290
0291 graph1D_jd(x1,y1,0,0,xlab,ylab,tit,NaN,xlim,ylim,style,marker1,color2,width2,siz,gca,red,lspace,bspace2);
0292 graph1D_jd(x2,y2,0,0,'','','',NaN,xlim,ylim,style,marker1,color3,width2,siz);
0293 graph1D_jd(x3,y3,0,0,'','','',leg,xlim,ylim,style,marker2,color4,width2,siz);
0294
0295 print_jd(p_opt,['Fig_',shotnum,'_J'],[shotnum,'/figures'],11);
0296