iluke_hxrcamdisp

PURPOSE ^

SYNOPSIS ^

function iluke_hxrcamdisp(hxrcams,xlim,ylim,Rp,Zp,axs,style)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function iluke_hxrcamdisp(hxrcams,xlim,ylim,Rp,Zp,axs,style)
0002 %
0003 ncams = length(hxrcams);
0004 %
0005 ns = 1000;
0006 %
0007 colors = {'b',[0,0.5,0],'m','c','y'};
0008 %
0009 Rmax_hxr = NaN(1,ncams);
0010 Zmax_hxr = NaN(1,ncams);
0011 %
0012 for icam = 1:ncams,
0013     %
0014     cam = hxrcams{icam};
0015     %
0016     Rmax_hxr(icam) = cam.R_hxr(1);
0017     Zmax_hxr(icam) = cam.Z_hxr(1);    
0018     %
0019     smax = 4*Rp;
0020     %
0021     s = linspace(-smax,smax,2*ns+1);
0022     %
0023     [~,~,syx,syy,syz] = raypath_prop_jd(Rp,cam.R_hxr - Rp,cam.Z_hxr - Zp,0,cam.alpha_hxr,cam.beta_hxr,s);
0024     %
0025     syr = sqrt(syx.^2 + syy.^2);% distance to plasma center
0026     %
0027     syR = Rp + syx;
0028     syphi = -syz/Rp;% minus sign for LUKE convention
0029     %
0030     is = ns+1;% focal point
0031     %
0032     dir = sign(syr(is + 1,1) - syr(is,1));
0033     %
0034     if dir < 0,% forward direction,
0035         smask = is:2*ns+1;
0036     else% backward direction,
0037         smask = is:-1:1;
0038     end
0039     %
0040     syx = syx(smask,:);
0041     syy = syy(smask,:);
0042     syR = syR(smask,:);
0043     syphi = syphi(smask,:);
0044     %
0045     for iy = 1:size(syx,2),
0046         smask = find(syx(:,iy) < xlim(1),1,'first'):ns+1; 
0047         %
0048         syx(smask,iy) = NaN;
0049         syy(smask,iy) = NaN;
0050         syR(smask,iy) = NaN;
0051         syphi(smask,iy) = NaN;
0052     end        
0053     %
0054     graph1D_jd(syx,syy,0,0,'','','',NaN,NaN,NaN,'-','none',colors{icam},0.5,style,axs(1));
0055     graph1D_jd(syR.*cos(syphi),syR.*sin(syphi),0,0,'','','',NaN,NaN,NaN,'-','none',colors{icam},0.5,style,axs(2));
0056     %
0057     if cam.selectedchord > 0,
0058         graph1D_jd(syx(:,cam.selectedchord),syy(:,cam.selectedchord),0,0,'','','',NaN,NaN,NaN,'-','none','k',2,style,axs(1));
0059         graph1D_jd(syR(:,cam.selectedchord).*cos(syphi(:,cam.selectedchord)),syR(:,cam.selectedchord).*sin(syphi(:,cam.selectedchord)),0,0,'','','',NaN,NaN,NaN,'-','none','k',2,style,axs(2));
0060     end
0061     %
0062 end
0063 %
0064 xlim = [xlim(1),max([xlim(2),Rmax_hxr - Rp])];
0065 ylim = [min([ylim(1),Zmax_hxr - Zp]),max([ylim(2),Zmax_hxr - Zp])];
0066 Rmax = Rp + xlim(2);
0067 %
0068 set(axs(1),'xlim',xlim,'ylim',ylim);drawnow;
0069 set(axs(2),'xlim',[-Rmax,Rmax],'ylim',[-Rmax,Rmax]);drawnow;
0070 %

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