fproc_HXR_timescan

PURPOSE ^

SYNOPSIS ^

function fproc_HXR_timescan(basestr,file_str,shotnum,shotimes,id_simul_o,locpath_simul,it_disp,ic,krange,dtexp,HXRopt,cnumber,kdisp,p_opt,opt)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fproc_HXR_timescan(basestr,file_str,shotnum,shotimes,id_simul_o,locpath_simul,it_disp,ic,krange,dtexp,HXRopt,cnumber,kdisp,p_opt,opt)
0002 %
0003 savepath = [basestr,filesep,shotnum,filesep];
0004 path_simul = [savepath,locpath_simul];
0005 %
0006 hxr_file = [savepath,'HXR_',basestr,'_',shotnum,'.mat'];
0007 if ~exist(hxr_file,'file'),
0008     get_hxrspec_forLUKE_jd(basestr,str2num(shotnum),savepath)
0009 end
0010 %
0011 exp_file = [savepath,'HXREXP_',basestr,'_',shotnum,'.mat'];
0012 if ~exist(exp_file,'file'),
0013     collect_hxr_forLUKE_jd(basestr,str2num(shotnum),HXRopt,savepath)
0014 end
0015 %
0016 % select shot times
0017 %
0018 equilbase = [file_str,basestr,'_',shotnum,'_'];
0019 [shotimes,isel] = select_shotimes_jd(equilbase,[id_simul_o,'.mat'],path_simul,shotimes);
0020 nt = length(shotimes);
0021 %
0022 icdisp = 1 + cnumber - ic(1);
0023 %
0024 nc = length(ic);
0025 %nk = length(ik);
0026 %
0027 dI_tot = NaN(1,nt);
0028 dI_exp = NaN(1,nt);
0029 %dt = NaN(1,nt);
0030 %
0031 %dJ = NaN(nr,nt);
0032 %dxrho = NaN(nr,nt);
0033 %
0034 Tphplasma = NaN(nc,nt);
0035 Tphexp = NaN(nc,nt);
0036 Tphdiag = NaN(nc,nt);
0037 eTphplasma = NaN(nc,nt);
0038 eTphexp = NaN(nc,nt);
0039 eTphdiag = NaN(nc,nt);
0040 Aplasma = NaN(nc,nt);
0041 Aexp = NaN(nc,nt);
0042 Adiag = NaN(nc,nt);
0043 eAplasma = NaN(nc,nt);
0044 eAexp = NaN(nc,nt);
0045 eAdiag = NaN(nc,nt);
0046 Qplasma = NaN(nc,nt);
0047 Qexp = NaN(nc,nt);
0048 Qdiag = NaN(nc,nt);
0049 %
0050 %dNdtplasma = NaN(nk,nc,nt);
0051 %dNdtdiag = NaN(nk,nc,nt);
0052 %
0053 dvarplasma = NaN(1,nt);
0054 dvardiag = NaN(1,nt);
0055 %
0056 icpeak = NaN(1,nt);
0057 %
0058 for it = 1:nt,
0059     %
0060     shotime = shotimes{it};
0061     ttimes(it) = str2num(shotime);
0062     %
0063     id_equil = [equilbase,shotime];%For plasma equilibrium
0064     %
0065     id_simul = [id_equil,id_simul_o];
0066     %
0067     texp = [ttimes(it) - dtexp/2,ttimes(it) + dtexp/2]; 
0068     %
0069     [hxr_proc,hxr,data_proc] = fproc_hxr(basestr,path_simul,id_simul,hxr_file,exp_file,texp,ic,krange,opt);
0070     %
0071     if isempty(hxr_proc),
0072         if exist('dNdtplasma','var'),
0073             dNdtplasma(:,:,it) = NaN;
0074             dNdtdiag(:,:,it) = NaN;
0075         end
0076         %
0077         continue
0078     end
0079     %
0080     dI_tot(it) = data_proc.scalar.I_tot;
0081     dI_exp(it) = data_proc.scalar.I_exp;
0082     %
0083     dJ(:,it) = data_proc.radial.J_tot.';
0084     %
0085     if opt.rho == 'g',
0086         dxrho(:,it) = data_proc.radial.xrhoG.';
0087     elseif opt.rho == 'p',
0088         dxrho(:,it) = data_proc.radial.xrhoP.';
0089     elseif opt.rho == 't',
0090         dxrho(:,it) = data_proc.radial.xrhoT.';
0091     elseif opt.rho == 'v',
0092         dxrho(:,it) = data_proc.radial.xrhoV.';
0093     else
0094         error('rho type not recognized')
0095     end
0096     %
0097     %dxrho(:,it) = data_proc.radial.xrho.';
0098     %
0099     Tphplasma(:,it) = hxr_proc.Tphplasma;        
0100     Tphdiag(:,it) = hxr_proc.Tphdiag;        
0101     Aplasma(:,it) = hxr_proc.Aplasma;        
0102     Adiag(:,it) = hxr_proc.Adiag;        
0103     eAplasma(:,it) = hxr_proc.eAplasma;        
0104     eAdiag(:,it) = hxr_proc.eAdiag;        
0105     Qplasma(:,it) = hxr_proc.Qplasma;        
0106     Qdiag(:,it) = hxr_proc.Qdiag;        
0107     eTphplasma(:,it) = hxr_proc.eTphplasma;        
0108     eTphdiag(:,it) = hxr_proc.eTphdiag;        
0109     %
0110     dvarplasma(it) = hxr_proc.dvarplasma;        
0111     dvardiag(it) = hxr_proc.dvardiag;        
0112     %
0113     icpeak(it) = hxr_proc.icpeak;
0114     %
0115     ik = hxr_proc.ik;
0116     %
0117     dNdtplasma(:,:,it) = hxr_proc.dNdtplasma(ik,ic);
0118     dNdtdiag(:,:,it) = hxr_proc.dNdtdiag(ik,ic);
0119     %
0120     %dt(it) = hxr.dt;
0121     %
0122     k(:,it) = hxr_proc.k(ik);
0123     %k2 = hxr_proc.k(ik2);
0124     %
0125     Tphexp(:,it) = hxr_proc.Tphexp;
0126     eTphexp(:,it) = hxr_proc.eTphexp;
0127     Aexp(:,it) = hxr_proc.Aexp;
0128     eAexp(:,it) = hxr_proc.eAexp;
0129     Qexp(:,it) = hxr_proc.Qexp;
0130     %
0131     dNdtexp(:,:,it) = hxr_proc.dNdtexp(ik,ic);
0132     %dNdtexp2(:,:,it) = hxr_proc.dNdtexp(ik2,ic);
0133     %
0134 end
0135 %
0136 dt = 0.016;%%%%%
0137 %
0138 if ~all(all(k == repmat(k(:,1),[1,nt]))),
0139     error('verify energy list')
0140 else
0141     k = k(:,1);
0142 end
0143 %
0144 nk = length(k);
0145 ikdisp = find(k == mean(kdisp));
0146 %
0147 dNdtdiag_disp = reshape(dNdtdiag(:,icdisp,:),[nk,nt]).';
0148 dNdtplasma_disp = reshape(dNdtplasma(:,icdisp,:),[nk,nt]).';
0149 dNdtexp_disp = reshape(dNdtexp(:,icdisp,:),[nk,nt]).';
0150 %
0151 sdNdtdiag = reshape(sum(dNdtdiag,1),[nc,nt]);%count rate
0152 sdNdtplasma = reshape(sum(dNdtplasma,1),[nc,nt]);%count rate
0153 sdNdtexp = reshape(sum(dNdtexp,1),[nc,nt]);%count rate
0154 %
0155 ndNdtdiag = sdNdtdiag./repmat(sdNdtdiag(icdisp,:),[nc,1]);%count rate
0156 ndNdtplasma = sdNdtplasma./repmat(sdNdtplasma(icdisp,:),[nc,1]);%count rate
0157 ndNdtexp = sdNdtexp./repmat(sdNdtexp(icdisp,:),[nc,1]);%count rate
0158 %
0159 endNdtdiag = sqrt(sdNdtdiag/dt)./repmat(sdNdtdiag(icdisp,:),[nc,1]);%count rate
0160 endNdtplasma = sqrt(sdNdtplasma/dt)./repmat(sdNdtplasma(icdisp,:),[nc,1]);%count rate
0161 endNdtexp = sqrt(sdNdtexp/dt)./repmat(sdNdtexp(icdisp,:),[nc,1]);%count rate
0162 %
0163 style0 = 'none';
0164 style = '-';
0165 style2 = '--';
0166 marker = 'none';
0167 marker1 = '+';
0168 marker2 = 'o';
0169 marker3 = 's';
0170 marker4 = '.';
0171 markers = {marker1,marker2,marker3};
0172 color = NaN;
0173 color1 = 'k';
0174 color2 = 'r';
0175 color3 = 'b';
0176 color4 = 'g';
0177 color5 = 'm';
0178 color6 = 'c';
0179 colors = {color2,color3,color4,color5};
0180 %
0181 width = 0.5;
0182 width2 = 2;
0183 siz = 20+14*1i;
0184 %
0185 red = 0.9;
0186 lspace = 0.7;
0187 lspace2 = 0.5;
0188 bspace = 0.7;
0189 bspace2 = 0.6;%0.5;
0190 %
0191 xlab_ic = 'chord #';
0192 xlim_ic = [min(ic),max(ic)];
0193 xtick_ic = 0:5:60;
0194 %
0195 ncol = length(colors);
0196 %
0197 chordstr = ['chord # ',num2str(cnumber)];
0198 timestr = '';
0199 for it = 1:length(it_disp),
0200     timestr = [timestr,'t = ',shotimes{it_disp(it)},' (',colors{rem(it,ncol)},'); '];
0201 end
0202 kstr = ['k = ',num2str(kdisp(1)),'-',num2str(kdisp(2)),' keV'];
0203 %
0204 kmin = min(k);
0205 kmax = max(k);
0206 %
0207 krangestr = ['k = ',num2str(kmin),' - ',num2str(kmax),' keV'];
0208 %
0209 if opt.xdisp == 0,
0210     x = ttimes;
0211     xlab = 't (s)';
0212 else
0213     [nvol,tn]=tsbase(str2double(shotnum),'sprofnmoy');
0214     if isempty(nvol),
0215         [nvol,tn]=tsbase(str2double(shotnum),'snmoy');
0216         nvol = nvol/1e19;
0217     end
0218     x = interp1(tn,nvol,ttimes);
0219     xlab = 'volumic density (\times 10^{19} m^{-3})';
0220 end
0221 %
0222 if isfield(opt,'xlim'),
0223     xlim = opt.xlim;
0224 else
0225     xlim = [fix(x(1)),ceil(x(end))];
0226 end
0227 %
0228 if isfield(opt,'xtick'),
0229     xtick = opt.xtick;
0230 else
0231     xtick = xlim(1):ceil(diff(xlim)/5):xlim(2);
0232 end
0233 %
0234 if isfield(opt,'icrej_exp') && ~isempty(opt.icrej_exp),
0235     maskic_exp = ~any(repmat(ic,[length(opt.icrej_exp),1]) == repmat(opt.icrej_exp.',[1,length(ic)]),1);
0236 else
0237     maskic_exp = 1:nc;
0238 end
0239 %
0240 % --------------------- Current -----------------------
0241 %
0242 ifig = 1;figure(ifig),clf,set(ifig,'Name','Current')
0243 %
0244 ylab = 'Current (kA)';
0245 tit = '';
0246 if isfield(opt,'ylim_I'),
0247     ylim = opt.ylim_I;
0248 else
0249     ylim = 1e3*[0,max([dI_tot,dI_exp])]*1.2;
0250 end
0251 %
0252 leg = {'LUKE'};
0253 %
0254 if ~all(isnan(dI_exp)) && (~isfield(opt,'I_exp') || opt.I_exp == 1),
0255     graph1D_jd(x,dI_exp*1e3,0,0,'','','',NaN,xlim,ylim,style,marker,color1,width2,siz);
0256     leg = ['Exp.',leg];
0257 end
0258 graph1D_jd(x,dI_tot*1e3,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker2,color2,width2,siz,gca,red,lspace,bspace);
0259 %
0260 set(gca,'xtick',xtick);
0261 %set(gca,'xminorgrid','off')
0262 %set(gca,'xminortick','off')
0263 %
0264 print_jd(p_opt,['Fig_I_tot',id_simul_o],[savepath,'figures/'],ifig);
0265 %
0266 % --------------------- TPH 2D -----------------------
0267 %
0268 ifig = 2;figure(ifig),clf,set(ifig,'Name','TPH2D')
0269 %
0270 ylab = 'Photon Temperature (keV)';
0271 tit = timestr;
0272 %
0273 ylim = [0,60];%[0,max(max([Tphplasma,Tphdiag,Tphexp]))]*1.2;
0274 %ytick = 0:2:10;
0275 %
0276 leg = {'LUKE'};%{'plasma','diag.'};%
0277 %
0278 if ~all(isnan(Tphexp(:,it_disp(1)))),
0279     if length(it_disp) > 1,
0280         localcol = colors{rem(1,ncol)};
0281         localwidth = width;
0282     else
0283         localcol = color1;
0284         localwidth = width2;
0285     end
0286     graph1D_jd(ic(maskic_exp),Tphexp(maskic_exp,it_disp(1)),0,0,'','','',NaN,xlim_ic,ylim,style,marker,localcol,localwidth,siz,gca,1,lspace,bspace2,eTphexp(maskic_exp,1));
0287     leg = ['Exp.',leg];
0288 end
0289 %graph1D_jd(ic,Tphplasma(:,1),0,0,'','','',NaN,xlim_ic,ylim,style,marker2,colors{rem(1,ncol)},width2,siz,gca,1,lspace,bspace2,eTphplasma(:,1));
0290 graph1D_jd(ic,Tphdiag(:,it_disp(1)),0,0,xlab_ic,ylab,tit,leg,xlim_ic,ylim,style,marker3,colors{rem(1,ncol)},width2,siz,gca,red,lspace,bspace2,eTphdiag(:,1));
0291 for it = 2:length(it_disp),
0292     %graph1D_jd(ic,Tphplasma(:,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker2,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,eTphplasma(:,it));
0293     graph1D_jd(ic,Tphdiag(:,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker3,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,eTphdiag(:,it));
0294     if ~all(isnan(Tphexp(:,it_disp(it)))),
0295         graph1D_jd(ic(maskic_exp),Tphexp(maskic_exp,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker,colors{rem(it,ncol)},width,siz,gca,1,lspace,bspace2,eTphexp(maskic_exp,it));
0296     end
0297 end
0298 %
0299 set(gca,'xtick',xtick_ic);
0300 %set(gca,'ytick',ytick);
0301 %
0302 print_jd(p_opt,['Fig_TPH_2D',id_simul_o],[savepath,'figures/'],ifig);
0303 %
0304 % --------------------- TPH 1D -----------------------
0305 %
0306 ifig = 3;figure(ifig),clf,set(ifig,'Name','TPH1D')
0307 %
0308 ylab = 'Photon Temperature (keV)';
0309 tit = chordstr;
0310 %
0311 ylim = [0,max([Tphplasma(icdisp,:),Tphdiag(icdisp,:),Tphexp(icdisp,:)])]*1.2;
0312 %ytick = 0:2:10;
0313 %
0314 leg = {'LUKE'};%{'plasma','diag.'};%
0315 %
0316 if ~all(isnan(Tphexp(icdisp,:))),
0317     graph1D_jd(x,Tphexp(icdisp,:),0,0,'','','',NaN,xlim,ylim,style,marker,color1,width2,siz,gca,1,lspace,bspace2,eTphexp(icdisp,:));
0318     leg = ['Exp.',leg];
0319 end
0320 %graph1D_jd(x,Tphplasma(icdisp,:),0,0,'','','',NaN,xlim,ylim,style,marker2,color2,width2,siz,gca,1,lspace,bspace2,eTphplasma(icdisp,:));
0321 graph1D_jd(x,Tphdiag(icdisp,:),0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker2,color2,width2,siz,gca,red,lspace,bspace2,eTphdiag(icdisp,:));
0322 %
0323 set(gca,'xtick',xtick);
0324 %set(gca,'ytick',ytick);
0325 %
0326 print_jd(p_opt,['Fig_TPH_1D_ic',num2str(cnumber),id_simul_o],[savepath,'figures/'],ifig);
0327 %
0328 % --------------------- COUNT RATE 1D total -----------------------
0329 %
0330 ifig = 4;figure(ifig),clf,set(ifig,'Name','CR 1D Total')
0331 %
0332 ylab = ['Count rate (s^{-1})'];
0333 tit = [chordstr,'; ',krangestr];
0334 %
0335 if isfield(opt,'ylim_CR1D_tot'),
0336     ylim = opt.ylim_CR1D_tot;
0337 else
0338     ylim = 10.^[3,5];%[0,max(max([dNdtdiag_disp,dNdtexp_disp]))]*1.2;%dNdtplasma_disp,
0339 end
0340 %ytick = 10.^[3:5];
0341 %
0342 leg = {'LUKE'};%{'plasma','diag.'};%
0343 %
0344 if ~all(isnan(dNdtexp(1,icdisp,:))),
0345     graph1D_jd(x,sdNdtexp(icdisp,:),0,1,'','','',NaN,xlim,ylim,style,marker,color1,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtdiag_disp(:,1)/dt));
0346     leg = ['Exp.',leg];
0347 end
0348 %graph1D_jd(x,sdNdtplasma(icdisp,:),0,1,'','','',NaN,xlim,ylim,style,marker2,color3,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtplasma_disp(:,1)/dt));
0349 graph1D_jd(x,sdNdtdiag(icdisp,:),0,1,xlab,ylab,tit,leg,xlim,ylim,style,marker3,color2,width2,siz,gca,red,lspace,bspace2,sqrt(dNdtdiag_disp(:,1)/dt));
0350 %
0351 set(gca,'xtick',xtick);
0352 %set(gca,'ytick',ytick);
0353 %
0354 print_jd(p_opt,['Fig_CR_1D_tot_ic',num2str(cnumber),id_simul_o],[savepath,'figures/'],ifig);
0355 %
0356 % --------------------- COUNT RATE 1D selected -----------------------
0357 %
0358 ifig = 5;figure(ifig),clf,set(ifig,'Name','CR 1D Selected')
0359 %
0360 ylab = ['Count rate (s^{-1})'];
0361 tit = [chordstr,'; ',kstr];
0362 %
0363 if isfield(opt,'ylim_CR1D_sel'),
0364     ylim = opt.ylim_CR1D_sel;
0365 else
0366     ylim = 10.^[3,5];%[0,max(max([dNdtdiag_disp,dNdtexp_disp]))]*1.2;%dNdtplasma_disp,
0367 end
0368 %ytick = 10.^[3:5];
0369 %
0370 leg = {'LUKE'};%{'plasma','diag.'};%
0371 %
0372 if ~all(isnan(dNdtexp(1,icdisp,:))),
0373 %     graph1D_jd(x,dNdtexp_disp(:,1),0,0,'','','',NaN,xlim,ylim,style,marker,color1,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtdiag_disp(:,1)/dt));
0374     graph1D_jd(x,dNdtexp_disp(:,ikdisp),0,1,'','','',NaN,xlim,ylim,style,marker,color1,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtdiag_disp(:,1)/dt));
0375     leg = ['Exp.',leg];
0376 end
0377 % %graph1D_jd(x,dNdtplasma_disp(:,1),0,0,'','','',NaN,xlim,ylim,style,marker2,color3,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtplasma_disp(:,1)/dt));
0378 % graph1D_jd(x,dNdtdiag_disp(:,1),0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker3,color2,width2,siz,gca,red,lspace,bspace2,sqrt(dNdtdiag_disp(:,1)/dt));
0379 %graph1D_jd(x,dNdtplasma_disp(:,ikdisp),0,1,'','','',NaN,xlim,ylim,style,marker2,color3,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtplasma_disp(:,1)/dt));
0380 graph1D_jd(x,dNdtdiag_disp(:,ikdisp),0,1,xlab,ylab,tit,leg,xlim,ylim,style,marker3,color2,width2,siz,gca,red,lspace,bspace2,sqrt(dNdtdiag_disp(:,1)/dt));
0381 % for ik = 2:nk,
0382 %     %graph1D_jd(x,dNdtplasma_disp(:,ik),0,0,'','','',NaN,xlim,ylim,style,marker2,color3,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtplasma_disp(:,ik)/dt));
0383 %     graph1D_jd(x,dNdtdiag_disp(:,ik),0,0,'','','',NaN,xlim,ylim,style,marker3,color2,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtdiag_disp(:,ik)/dt));
0384 %     if ~all(isnan(dNdtexp_disp(:,ik))),
0385 %         graph1D_jd(x,dNdtexp_disp(:,ik),0,0,'','','',NaN,xlim,ylim,style,marker,color1,width2,siz,gca,1,lspace,bspace2,sqrt(dNdtexp_disp(:,ik)/dt));
0386 %     end
0387 % end
0388 %
0389 set(gca,'xtick',xtick);
0390 %set(gca,'ytick',ytick);
0391 %
0392 print_jd(p_opt,['Fig_CR_1D_ic',num2str(cnumber),id_simul_o],[savepath,'figures/'],ifig);
0393 %
0394 %
0395 % --------------------- COUNT RATE 2D -----------------------
0396 %
0397 ifig = 6;figure(ifig),clf,set(ifig,'Name','CR 2D')
0398 %
0399 xlab = 'Chord #';
0400 ylab = ['Count rate (s^{-1}); ',krangestr];
0401 tit = timestr;
0402 %
0403 ylim = [0,max(max([sdNdtdiag;sdNdtexp(maskic_exp,:)]))]*1.2;%sdNdtplasma,
0404 %ytick = 0:2:10;
0405 %
0406 leg = {'LUKE'};%{'plasma','diag.'};%
0407 %
0408 if ~all(isnan(sdNdtexp(:,it_disp(1)))),
0409     if length(it_disp) > 1,
0410         localcol = colors{rem(1,ncol)};
0411         localwidth = width;
0412     else
0413         localcol = color1;
0414         localwidth = width2;
0415     end
0416     graph1D_jd(ic(maskic_exp),sdNdtexp(maskic_exp,it_disp(1)),0,0,'','','',NaN,xlim_ic,ylim,style,marker,localcol,localwidth,siz,gca,1,lspace,bspace2,sqrt(sdNdtexp(maskic_exp,1)/dt));
0417     leg = ['Exp.',leg];
0418 end
0419 %graph1D_jd(ic,sdNdtplasma(:,it_disp(1)),0,0,'','','',NaN,xlim_ic,ylim,style,marker2,colors{rem(1,ncol)},width2,siz,gca,1,lspace,bspace2,sqrt(sdNdtplasma(:,1)/dt));
0420 graph1D_jd(ic,sdNdtdiag(:,it_disp(1)),0,0,xlab_ic,ylab,tit,leg,xlim_ic,ylim,style,marker3,colors{rem(1,ncol)},width2,siz,gca,red,lspace,bspace2,sqrt(sdNdtdiag(:,1)/dt));
0421 for it = 2:length(it_disp),
0422     %graph1D_jd(ic,sdNdtplasma(:,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker2,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,sqrt(sdNdtplasma(:,it)/dt));
0423     graph1D_jd(ic,sdNdtdiag(:,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker3,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,sqrt(sdNdtdiag(:,it)/dt));
0424     if ~all(isnan(sdNdtexp(:,it_disp(it)))),
0425         graph1D_jd(ic(maskic_exp),sdNdtexp(maskic_exp,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,sqrt(sdNdtexp(maskic_exp,it)/dt));
0426     end
0427 end
0428 %
0429 set(gca,'xtick',xtick_ic);
0430 %set(gca,'ytick',ytick);
0431 %
0432 print_jd(p_opt,['Fig_CR_2D',id_simul_o],[savepath,'figures/'],ifig);
0433 %
0434 %
0435 ifig = 7;figure(ifig),clf,set(ifig,'Name','CR 2D norm')
0436 %
0437 xlab = 'Chord #';
0438 ylab = ['Normalized Count rate; ',krangestr];
0439 tit = timestr;
0440 %
0441 ylim = [0,1.4];%sdNdtplasma,
0442 ytick = 0:0.2:1.4;
0443 %
0444 leg = {'LUKE'};%{'plasma','diag.'};%
0445 %
0446 if ~all(isnan(sdNdtexp(:,it_disp(1)))),
0447     if length(it_disp) > 1,
0448         localcol = colors{rem(1,ncol)};
0449         localwidth = width;
0450     else
0451         localcol = color1;
0452         localwidth = width2;
0453     end
0454     graph1D_jd(ic(maskic_exp),ndNdtexp(maskic_exp,it_disp(1)),0,0,'','','',NaN,xlim_ic,ylim,style,marker,localcol,localwidth,siz,gca,1,lspace,bspace2,endNdtexp(maskic_exp,1));
0455     leg = ['Exp.',leg];
0456 end
0457 %graph1D_jd(ic,ndNdtplasma(:,it_disp(1)),0,0,'','','',NaN,xlim_ic,ylim,style,marker2,colors{rem(1,ncol)},width2,siz,gca,1,lspace,bspace2,endNdtplasma(:,1);
0458 graph1D_jd(ic,ndNdtdiag(:,it_disp(1)),0,0,xlab_ic,ylab,tit,leg,xlim_ic,ylim,style,marker3,colors{rem(1,ncol)},width2,siz,gca,red,lspace,bspace2,endNdtdiag(:,1));
0459 for it = 2:length(it_disp),
0460     %graph1D_jd(ic,ndNdtplasma(:,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker2,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,endNdtplasma(:,it));
0461     graph1D_jd(ic,ndNdtdiag(:,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker3,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,endNdtdiag(:,it));
0462     if ~all(isnan(sdNdtexp(:,it_disp(it)))),
0463         graph1D_jd(ic(maskic_exp),ndNdtexp(maskic_exp,it_disp(it)),0,0,'','','',NaN,xlim_ic,ylim,style,marker,colors{rem(it,ncol)},width2,siz,gca,1,lspace,bspace2,endNdtexp(maskic_exp,it));
0464     end
0465 end
0466 %
0467 set(gca,'xtick',xtick_ic);
0468 set(gca,'ytick',ytick);
0469 %
0470 print_jd(p_opt,['Fig_CR_2D_norm',id_simul_o],[savepath,'figures/'],ifig);
0471 %
0472 %
0473 return
0474 %
0475 ifig = 7;figure(ifig),clf,set(ifig,'Name','Current profiles')
0476 %
0477 xlab = '\rho';
0478 ylab = 'J - J_{\Omega} (MA/m^2)';
0479 tit = '';
0480 %
0481 xlim = [0,1];
0482 ylim = NaN;
0483 xtick = 0:0.2:1;
0484 %ytick = 0:0.2:1.4;
0485 %
0486 leg = {};%{'LUKE'};%{'plasma','diag.'};%
0487 %
0488 for ivar = 1:length(var_disp),
0489     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);   
0490     %
0491     if isempty(ivardisp),
0492         continue
0493     end
0494     %
0495     graph1D_jd(dxrho(:,ivardisp),dJ(:,ivardisp).' - J_ohm,0,0,'','','',NaN,xlim,ylim,...
0496         style,markers{ivar},colors{ivar},width2,siz);
0497     %
0498     leg = [leg,['D_0 = ',num2str(var_disp(ivar)),' m^2/s']];
0499     %
0500 end
0501 %
0502 Jfac = max(dJ(:,3).' - J_ohm);
0503 leg = [leg,'Exp.'];
0504 graph1D_jd(xrho_exp,J_exp*Jfac,0,0,xlab,ylab,tit,leg,xlim,ylim,style,marker,color1,width2,siz,gca,red,lspace,bspace);
0505 %
0506 set(gca,'xtick',xtick);
0507 %set(gca,'ytick',ytick);
0508 %
0509 print_jd(p_opt,['Fig_Jcomp_',id_simul_0],[path_simul,'figures/'],ifig);
0510 %
0511 %
0512 %
0513 figure(7),clf,set(7,'Name','Selected Count rate')
0514 %
0515 xlim = [min(ic)-1,max(ic)+1];
0516 ylab = ['Count rate (s^{-1}) [',num2str(kmin),' - ',num2str(kmax),' keV]'];
0517 ylim = NaN;%[0,2500];
0518 %ytick = 0:500:2500;
0519 %
0520 leg = {};
0521 %
0522 for ivar = 1:length(var_disp),
0523     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);   
0524     %
0525     if isempty(ivardisp),
0526         continue
0527     end
0528     %
0529     sdNdtdiag_disp = sdNdtdiag(:,ivardisp);%count rate
0530     %
0531     graph1D_jd(ic,sdNdtdiag_disp,0,0,'','','',NaN,xlim,ylim,...
0532         style,markers{ivar},colors{ivar},width2,siz,gca,1,lspace,bspace,sqrt(sdNdtdiag_disp/dt));
0533     %
0534     leg = [leg,['D_0 = ',num2str(var_disp(ivar)),' m^2/s']];
0535     %
0536 end
0537 %
0538 set(gca,'xtick',xtick_ic);
0539 %set(gca,'ytick',ytick);
0540 %
0541 %
0542 leg = [leg,'Exp.'];
0543 %
0544 graph1D_jd(ic,sdNdtexp,0,0,xlab,ylab,tit,leg,xlim,ylim,...
0545     style,marker,color1,width2,siz,gca,red,lspace,bspace,sqrt(sdNdtexp/dt));
0546 %
0547 % for ivar = 1:length(var_disp),
0548 %     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);
0549 %     %
0550 %     if isempty(ivardisp),
0551 %         continue
0552 %     end
0553 %     %
0554 %     sdNdtplasma_disp = sdNdtplasma(:,ivardisp);%number of counts
0555 %     %
0556 %     graph1D_jd(ic,sdNdtplasma_disp,0,0,'','','',NaN,xlim,ylim,...
0557 %         style2,markers{ivar},colors{ivar},width2,siz,gca,1,lspace,bspace,sqrt(sdNdtplasma_disp/dt));
0558 %     %
0559 % end
0560 %
0561 print_jd(p_opt,['Fig_select_countrate_',num2str(vmindisp),'_',id_simul_0],[path_simul,'figures/'],7);
0562 %
0563 %
0564 %
0565 figure(8),clf,set(8,'Name','Selected Norm Count rate')
0566 %
0567 xlim = [min(ic)-1,max(ic)+1];
0568 ylab = ['Normalized Count rate [',num2str(kmin),' - ',num2str(kmax),' keV]'];
0569 ylim = [0,1.4];%sdNdtplasma,
0570 ytick = 0:0.2:1.4;
0571 %
0572 leg = {};
0573 %
0574 for ivar = 1:length(var_disp),
0575     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);   
0576     %
0577     if isempty(ivardisp),
0578         continue
0579     end
0580     %
0581     ndNdtdiag_disp = ndNdtdiag(:,ivardisp);%count rate
0582     endNdtdiag_disp = endNdtdiag(:,ivardisp);%count rate
0583     %
0584     graph1D_jd(ic,ndNdtdiag_disp,0,0,'','','',NaN,xlim,ylim,...
0585         style,markers{ivar},colors{ivar},width2,siz,gca,1,lspace,bspace,endNdtdiag_disp);
0586     %
0587     leg = [leg,['D_0 = ',num2str(var_disp(ivar)),' m^2/s']];
0588     %
0589 end
0590 %
0591 set(gca,'xtick',xtick_ic);
0592 set(gca,'ytick',ytick);
0593 %
0594 %
0595 leg = [leg,'Exp.'];
0596 %
0597 graph1D_jd(ic,ndNdtexp,0,0,xlab,ylab,tit,leg,xlim,ylim,...
0598     style,marker,color1,width2,siz,gca,red,lspace,bspace,endNdtexp);
0599 %
0600 % for ivar = 1:length(var_disp),
0601 %     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);
0602 %     %
0603 %     if isempty(ivardisp),
0604 %         continue
0605 %     end
0606 %     %
0607 %     ndNdtplasma_disp = ndNdtplasma(:,ivardisp);%number of counts
0608 %     endNdtplasma_disp = endNdtplasma(:,ivardisp);%number of counts
0609 %     %
0610 %     graph1D_jd(ic,ndNdtplasma_disp,0,0,'','','',NaN,xlim,ylim,...
0611 %         style2,markers{ivar},colors{ivar},width2,siz,gca,1,lspace,bspace,endNdtplasma_disp);
0612 %     %
0613 % end
0614 %
0615 print_jd(p_opt,['Fig_select_norm_countrate_',num2str(vmindisp),'_',id_simul_0],[path_simul,'figures/'],8);
0616 %
0617 %
0618 figure(9),clf,set(9,'Name','TPH_chord')
0619 %
0620 kmin = min(k);
0621 %
0622 xlab = 'Chord #';
0623 ylab = ['Photon temperature (keV)'];
0624 tit = '';
0625 %
0626 xlim = [min(ic)-1,max(ic)+1];
0627 ylim = NaN;%[0,2500];
0628 %ytick = 0:500:2500;
0629 %
0630 leg = {};
0631 %
0632 % for ivar = 1:length(var_disp),
0633 %     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);
0634 %     %
0635 %     if isempty(ivardisp),
0636 %         continue
0637 %     end
0638 %     %
0639 %     maskQdiag = (1 - Qdiag(:,ivardisp,ivdisp) < 1e-2) & (Tphdiag(:,ivardisp,ivdisp) > eTphdiag(:,ivardisp,ivdisp));
0640 %     %
0641 %     graph1D_jd(ic(maskQdiag),Tphdiag(maskQdiag,ivardisp,ivdisp),0,0,'','','',NaN,xlim,ylim,...
0642 %         style,markers{ivar},colors{ivar},width2,siz,gca,1,lspace,bspace,eTphdiag(maskQdiag,ivardisp,ivdisp));
0643 %     %
0644 %     leg = [leg,['D_0 = ',num2str(var_disp(ivar)),' m^2/s']];
0645 %     %
0646 % end
0647 %
0648 set(gca,'xtick',xtick_ic);
0649 %set(gca,'ytick',ytick);
0650 %
0651 leg = [leg,'Exp.'];
0652 %
0653 maskexp = (1 - Qexp < 1e-2) & (Tphexp > eTphexp);
0654 %
0655 graph1D_jd(ic(maskexp),Tphexp(maskexp),0,0,xlab,ylab,tit,leg,xlim,ylim,...
0656     style,marker,color1,width2,siz,gca,red,lspace,bspace,eTphexp(maskexp));
0657 %
0658 % for ivar = 1:length(var_disp),
0659 %     ivardisp = find(abs(var_list - var_disp(ivar)) < 10*eps);
0660 %     %
0661 %     if isempty(ivardisp),
0662 %         continue
0663 %     end
0664 %     %
0665 %     maskQplasma = (1 - Qplasma(:,ivardisp,ivdisp) < 1e-2) & (Tphplasma(:,ivardisp,ivdisp) > eTphplasma(:,ivardisp,ivdisp));
0666 %     %
0667 %     graph1D_jd(ic(maskQplasma),Tphplasma(maskQplasma,ivardisp,ivdisp),0,0,'','','',NaN,xlim,ylim,...
0668 %         style,markers{ivar},colors{ivar},width2,siz,gca,1,lspace,bspace,eTphplasma(maskQplasma,ivardisp,ivdisp));
0669 %     %
0670 %     leg = [leg,['D_0 = ',num2str(var_disp(ivar)),' m^2/s']];
0671 %     %
0672 % end
0673 %
0674 print_jd(p_opt,['Fig_1D_tph_chord_',num2str(vmindisp),'_',id_simul_0],[path_simul,'figures/'],9);
0675 %
0676 %
0677 figure(10),clf,set(10,'Name','Exp prof')
0678 %
0679 ylim = [0,1.2];
0680 ytick = 0:0.2:1.2;
0681 %
0682 Nnorm = dNdtexp.'./repmat(max(dNdtexp.'),[nc,1]);
0683 eNnorm = sqrt(dNdtexp.'/dt)./repmat(max(dNdtexp.'),[nc,1]);
0684 %
0685 leg = {};
0686 for iik = 1:length(k),
0687     leg{iik} = ['k = ',num2str(k(iik)),' keV'];
0688 end
0689 %
0690 graph1D_jd(repmat(ic.',[1,length(k)]),Nnorm,0,0,xlab,ylab,tit,leg,xlim,ylim,...
0691     style,marker,color,width2,siz,gca,red,lspace,bspace,eNnorm);
0692 %
0693 set(gca,'xtick',xtick_ic);
0694 set(gca,'ytick',ytick);
0695 %
0696 print_jd(p_opt,['Fig_countrate_exp_',num2str(vmindisp),'_',id_simul_0],[path_simul,'figures/'],10);
0697 %
0698 
0699 
0700 % %
0701 % figure(3),clf,set(3,'Name','Deposition peak')
0702 % %
0703 % ylab = '\rho_{peak}';
0704 % tit = '';
0705 % ylim = [0,1];
0706 % %
0707 % leg = {'LUKE','C3PO'};
0708 % %
0709 % if firstref,
0710 %     graph1D_jd(xlim,[drho(1),drho(1)],xlog,0,'','','',NaN,xlim,ylim,style,marker,color3,width,siz);
0711 %     leg = [[var_lab,' = ',num2str(var_list(1))],leg];
0712 % end
0713 % %
0714 % if lastref,
0715 %     graph1D_jd(xlim,[drho(end),drho(end)],xlog,0,'','','',NaN,xlim,ylim,style2,marker,color3,width,siz);
0716 %     leg = [[var_lab,' = ',num2str(var_list(end))],leg];
0717 % end
0718 % %
0719 % graph1D_jd(var_list(mask),drho(mask),xlog,0,'','','',NaN,xlim,ylim,style,marker2,color2,width2,siz);
0720 % graph1D_jd(var_list(mask),drho_lin(mask),xlog,0,xlab,ylab,tit,leg,xlim,ylim,style,marker1,color3,width2,siz,gca,red,lspace,bspace);
0721 % %
0722 % set(gca,'xtick',xtick);
0723 % set(gca,'xminorgrid','off')
0724 % set(gca,'xminortick','off')
0725 % %
0726 % print_jd(p_opt,['Fig_rho_peak_',id_simul_0],[path_simul,'figures/'],3);
0727 % %
0728 % %
0729 % %
0730 % figure(4),clf,set(4,'Name','RF ray fragments')
0731 % %
0732 % ylab = 'RF ray fragments';
0733 % tit = '';
0734 % ylim = NaN;
0735 % %
0736 % leg = {};
0737 % %
0738 % if firstref,
0739 %     graph1D_jd(xlim,[dnfrags(1),dnfrags(1)],xlog,0,'','','',NaN,xlim,ylim,style,marker,color3,width,siz);
0740 %     leg = [[var_lab,' = ',num2str(var_list(1))],leg];
0741 % end
0742 % %
0743 % if lastref,
0744 %     graph1D_jd(xlim,[dnfrags(end),dnfrags(end)],xlog,0,'','','',NaN,xlim,ylim,style2,marker,color3,width,siz);
0745 %     leg = [[var_lab,' = ',num2str(var_list(end))],leg];
0746 % end
0747 % %
0748 % graph1D_jd(var_list(mask),dnfrags(mask),xlog,0,xlab,ylab,tit,leg,xlim,ylim,style,marker2,color2,width2,siz,gca,red,lspace,bspace);
0749 % %
0750 % set(gca,'xtick',xtick);
0751 % set(gca,'xminorgrid','off')
0752 % set(gca,'xminortick','off')
0753 % %
0754 % print_jd(p_opt,['Fig_nfrags_',id_simul_0],[path_simul,'figures/'],4);
0755 % %
0756 % %
0757 % xlab = '\rho';
0758 % xlim = [0,1];
0759 % xtick = 0:0.2:1;
0760 % %
0761 % figure(5),clf,set(5,'Name','Deposition profile')
0762 % %
0763 % ylab = 'dP/d\rho/(2\piR_p) (MW/m)';
0764 % tit = '';
0765 % ylim = NaN;
0766 % %
0767 % leg = {'C3PO','LUKE'};
0768 % %
0769 % graph1D_jd(dxrho(ivar_C3PO,:),dwxdPdrho_rf_2piRp_lin(ivar_C3PO,:),0,0,xlab,ylab,tit,NaN,xlim,ylim,style2,marker,color,width,siz,gca,red,lspace,bspace);
0770 % graph1D_jd(dxrho(ivar_C3PO,:),dwxdPdrho_rf_2piRp,0,0,'','','',leg,xlim,ylim,style,marker,color,width2,siz);
0771 % %
0772 % set(gca,'xtick',xtick);
0773 % %
0774 % print_jd(p_opt,['Fig_profile_',id_simul_0],[path_simul,'figures/'],5);
0775 % %

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