Home > pubtools > Aperture > plotERAperture.m

plotERAperture

PURPOSE ^

function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok<INUSD>

SYNOPSIS ^

function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok

DESCRIPTION ^

function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok<INUSD>

 Plots RApertures EApertures aperture.
 
 use with atplot(atlattice,@plotAperture);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok<INUSD>
0002 %function plotdata=plotERAperture(lindata,ring,dpp,varargin) %#ok<INUSD>
0003 %
0004 % Plots RApertures EApertures aperture.
0005 %
0006 % use with atplot(atlattice,@plotAperture);
0007 %
0008 
0009 rapind=findcells(ring,'RApertures');
0010 eapind=findcells(ring,'EApertures');
0011 
0012 xm=getcellstruct(ring,'RApertures',rapind,1);
0013 ym=getcellstruct(ring,'RApertures',rapind,3);
0014 xp=getcellstruct(ring,'RApertures',rapind,2);
0015 yp=getcellstruct(ring,'RApertures',rapind,4);
0016 eh=getcellstruct(ring,'EApertures',eapind,1);
0017 ev=getcellstruct(ring,'EApertures',eapind,2);
0018 
0019 Xp=[nan(size(ring)); nan];
0020 Xm=Xp;
0021 Yp=Xp;
0022 Ym=Xp;
0023 Eh=Xp;
0024 Ev=Xp;
0025 
0026 Xp(rapind)=xp;
0027 Xm(rapind)=xm;
0028 Yp(rapind)=yp;
0029 Ym(rapind)=ym;
0030 Eh(eapind)=eh;
0031 Ev(eapind)=ev;
0032 
0033 
0034 Xp=fixgaps(Xp);
0035 Xm=fixgaps(Xm);
0036 Yp=fixgaps(Yp);
0037 Ym=fixgaps(Ym);
0038 Eh=fixgaps(Eh);
0039 Ev=fixgaps(Ev);
0040 
0041 plotdata(1).values=[Xp -Xm Yp -Ym]*1e2;%
0042 plotdata(1).labels={'x ','x','y','y'};
0043 plotdata(1).axislabel='rectangular aperture [cm]';
0044 %
0045 plotdata(2).values=[Eh Ev]*1e2;%
0046 plotdata(2).labels={'hor.','ver.'};
0047 plotdata(2).axislabel='elliptic aperture [cm]';
0048 %
0049 
0050 end 
0051 
0052 function y=fixgaps(x)
0053 % FIXGAPS Linearly interpolates gaps in a time series
0054 % YOUT=FIXGAPS(YIN) linearly interpolates over NaN
0055 % in the input time series (may be complex), but ignores
0056 % trailing and leading NaN.
0057 %
0058 
0059 % R. Pawlowicz 6/Nov/99
0060 y=x;
0061 
0062 
0063 bd=isnan(x);
0064 gd=find(~bd);
0065 
0066 if length(gd)>2 % modify for plot in AT
0067 
0068 bd([1:(min(gd)-1) (max(gd)+1):end])=0;
0069 
0070 
0071 y(bd)=interp1(gd,x(gd),find(bd)); 
0072 end
0073 
0074 end

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005