Home > pubtools > LatticeTuningFunctions > errors > errordisplayfunctions > GetMisalignments.m

GetMisalignments

PURPOSE ^

this function retrives 3 vectors, for x and y misalignments and tilts

SYNOPSIS ^

function [X,Y,T]=GetMisalignments(THERING,varargin)

DESCRIPTION ^

 this function retrives 3 vectors, for x and y misalignments and tilts
 the vectors are length of THERING

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [X,Y,T]=GetMisalignments(THERING,varargin)
0002 % this function retrives 3 vectors, for x and y misalignments and tilts
0003 % the vectors are length of THERING
0004 
0005 if numel(varargin)==1
0006     indxerrors=varargin{1};
0007 else
0008     indxerrors=1:length(THERING);
0009 end
0010 
0011 X=zeros(size(indxerrors));
0012 Y=zeros(size(indxerrors));
0013 t1=findcells(THERING(indxerrors),'T1');
0014 if ~isempty(t1)
0015     X(t1)=-getcellstruct(THERING(indxerrors),'T1',t1,1);
0016     Y(t1)=-getcellstruct(THERING(indxerrors),'T1',t1,3);
0017 end
0018 
0019 T=zeros(size(indxerrors));
0020 %r1=findcells(THERING(indxerrors),'R1');
0021 tiltedelem=[findcells(THERING(indxerrors),'Tilt')];
0022 rotelem=[findcells(THERING(indxerrors),'RotAboutS')];
0023 
0024 if ~isempty(tiltedelem) || ~isempty(rotelem)
0025   
0026     T(tiltedelem)=getcellstruct(THERING(indxerrors),'Tilt',tiltedelem);
0027     T(rotelem)=getcellstruct(THERING(indxerrors),'RotAboutS',rotelem);
0028     T(T<1e-7 & T>-1e-7)=0;
0029 end

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