0001 function ring=UniformMagGroupsErrors(ring)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 mag_groups=getMagGroupsFromMagNum(ring);
0012
0013 for i=1:length(mag_groups)
0014
0015
0016 ind=mag_groups{i};
0017 if length(ind)>1
0018
0019
0020 if isfield(ring{ind(1)},'T1')
0021 T1=ring{ind(1)}.T1;
0022 else
0023 T1=zeros(6,1);
0024 end
0025
0026 if isfield(ring{ind(1)},'T2')
0027 T2=ring{ind(1)}.T2;
0028 else
0029 T2=zeros(6,1);
0030 end
0031
0032 if isfield(ring{ind(1)},'R1')
0033 R1=ring{ind(1)}.R1;
0034 else
0035 R1=eye(6,6);
0036 end
0037
0038 if isfield(ring{ind(1)},'R2')
0039 R2=ring{ind(1)}.R2;
0040 else
0041 R2=eye(6,6);
0042 end
0043
0044 if isfield(ring{ind(1)},'Tilt')
0045 Tilt=ring{ind(1)}.Tilt;
0046 else
0047 Tilt=0;
0048 end
0049
0050 if isfield(ring{ind(1)},'DeltaS')
0051 DeltaS=ring{ind(1)}.DeltaS;
0052 else
0053 DeltaS=0;
0054 end
0055
0056
0057 for isl=1:length(ind)
0058
0059
0060 ring{ind(isl)}.T1=T1;
0061 ring{ind(isl)}.T2=T2;
0062 ring{ind(isl)}.R1=R1;
0063 ring{ind(isl)}.R2=R2;
0064 ring{ind(isl)}.Tilt=Tilt;
0065 ring{ind(isl)}.DeltaS=DeltaS;
0066
0067 end
0068 end
0069
0070 end
0071
0072