Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune, chromaticity and detuning periodicty #837

Merged
merged 14 commits into from
Oct 22, 2024
10 changes: 6 additions & 4 deletions atmat/attests/pytests.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,25 @@ function offmomdf(testCase, dp)
function tunechrom4(testCase,lat,dp)
% test on and off-momentum tunes of 4D lattices
lattice=testCase.ring4.(lat);
periodicity = atGetRingProperties(lattice.m,'Periodicity');
[mtune,mchrom]=tunechrom(lattice.m,'get_chrom',dp=dp);
ptune=double(lattice.p.get_tune(pyargs(dp=dp)));
pchrom=double(lattice.p.get_chrom(pyargs(dp=dp)));
testCase.verifyEqual(mtune,ptune,AbsTol=2.e-9);
testCase.verifyEqual(mchrom,pchrom,AbsTol=3.e-4);
testCase.verifyEqual(mod(mtune*periodicity,1),ptune,AbsTol=2.e-9);
testCase.verifyEqual(mchrom*periodicity,pchrom,AbsTol=3.e-4);
end

function tunechrom6(testCase,lat2,dp)
% test on and off-momentum tunes of 6D lattices
lattice=testCase.ring6.(lat2);
periodicity = atGetRingProperties(lattice.m,'Periodicity');
mlat=atsetcavity(lattice.m,frequency='nominal',dp=dp);
plat=lattice.p.set_rf_frequency(pyargs(dp=dp,copy=true));
[mtune,mchrom]=tunechrom(mlat,'get_chrom');
ptune=double(plat.get_tune());
pchrom=double(plat.get_chrom());
testCase.verifyEqual(mtune,ptune,AbsTol=1.e-9);
testCase.verifyEqual(mchrom,pchrom,AbsTol=2.e-4);
testCase.verifyEqual(mod(mtune*periodicity,1),ptune,AbsTol=1.e-9);
testCase.verifyEqual(mchrom*periodicity,pchrom,AbsTol=2.e-4);
end

function linopt1(testCase,dp)
Expand Down
Loading