Replies: 1 comment
-
Hi @lnadolski. In Matlab, I don't think there is a function for splitting a portion of a ring in small slices. So the easiest solution is probably to extract from atbaseplot the few lines doing that and building a new function. It's in % Split the ring
elmlength=findspos(ring0(el1:el2-1),el2-el1+1)/npts;
r2=cellfun(@splitelem,ring0(el1:el2-1),'UniformOutput',false);
ring=cat(1,ring0(1:el1-1),r2{:},ring0(el2:elt0)); and lines 140-150: function newelems=splitelem(elem)
if isfield(elem,'Length') && elem.Length > 0
nslices=ceil(elem.Length/elmlength);
if ~KeepAxis
newelems=atdivelem(elem,ones(1,nslices)./nslices);
else
newelems=atdivelem(elem,ones(1,nslices)./nslices,'KeepAxis');
end
else
newelems={elem};
end
end
To be noted: in the more recent pyAT, the Lattice object has a method for splitting lattice elements within a range of interest. So if you (or anyone else) feel like doing the same in Matlab, you are welcome! |
Beta Was this translation helpful? Give feedback.
-
Dear all,
I am looking for a function to get the twiss functions with a refined sampling rate as in the function atplot when with specify a s-range.
Is there a way to get, let us say, the beta function every 10 cm along the lattice ?
If I play with the variable curve from curve = aplot(myring), I can get the data but this is a little bit painful.
Thank you for your suggestions,
Laurent.
Beta Was this translation helpful? Give feedback.
All reactions