Skip to content

Commit

Permalink
matlab test
Browse files Browse the repository at this point in the history
  • Loading branch information
swhite2401 committed Sep 20, 2024
1 parent e12cc43 commit fd44720
Showing 1 changed file with 6 additions and 4 deletions.
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,'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(mtune*periodicity,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,'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(mtune*periodicity,ptune,AbsTol=1.e-9);
testCase.verifyEqual(mchrom*periodicity,pchrom,AbsTol=2.e-4);
end

function linopt1(testCase,dp)
Expand Down

0 comments on commit fd44720

Please sign in to comment.