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

Fix ohmienvelope wiggler mask #828

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions atmat/atmexall.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function atmexall(varargin)
% Diffusion matrices
cdir=fullfile(atroot,'atphysics','Radiation');
compile([alloptions, {passinclude}], fullfile(cdir,'findmpoleraddiffmatrix.c'));
compile([alloptions, {passinclude}], fullfile(cdir,'FDW.c'));

% RDTs
cdir=fullfile(atroot,'atphysics','NonLinearDynamics');
Expand Down
10 changes: 9 additions & 1 deletion atmat/atphysics/Radiation/ohmienvelope.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
% [1] K.Ohmi et al. Phys.Rev.E. Vol.49. (1994)
%
% [ENVELOPE, RMSDP, RMSBL] = ONMIENVELOPE(RING,RADELEMINDEX,REFPTS)
% RING - an AT ring
% RADELEMEINDEX - index of elements with radiative PassMethod,
% typically they finish in '...Rad'
% REFPTS - Reference points along the RING
%
% ENVELOPE is a structure with fields
% Sigma - [SIGMA(1); SIGMA(2)] - RMS size [m] along
Expand All @@ -21,13 +25,17 @@
% Returns in addition the 6x6 transfer matrices and the closed orbit
% from FINDM66

check_6d(ring, true, 'strict', 0);

NumElements = length(ring);
if nargin<3, refpts=1; end

% Erase wigglers from the radiative element list.
% Diffusion matrix to be computed with separate FDW function.
Wig=atgetcells(ring,'Bmax');
radindex = radindex & ~Wig;
[~,ia,~]= intersect(radindex, find(Wig));
radindex(ia) = [];


[mring, ms, orbit] = findm66(ring,1:NumElements+1);
mt=squeeze(num2cell(ms,[1 2]));
Expand Down
Loading