diff --git a/crpptbx/AUG/loadAUGdata.m b/crpptbx/AUG/loadAUGdata.m index c754704e5e213d691b7d8a100c3bc4a3f58de2f0..9ef11490be99b0fc1f5345a2143ab734de973eb8 100644 --- a/crpptbx/AUG/loadAUGdata.m +++ b/crpptbx/AUG/loadAUGdata.m @@ -893,7 +893,6 @@ switch AUGkeywrdcase{index} [PFxx,e]=rdaAUG_eff(shot,DIAG,'PFxx',shotfile_exp); [RPFx,e]=rdaAUG_eff(shot,DIAG,'RPFx',shotfile_exp); [zPFx,e]=rdaAUG_eff(shot,DIAG,'zPFx',shotfile_exp); - % seems "LCFS" q-value is far too large, limit to some max (when diverted) max_qValue = 40; % Note could just put a NaN on LCFS value since ill-defined when diverted for it=1:NTIME @@ -910,6 +909,21 @@ switch AUGkeywrdcase{index} equil.psi_axis(it)= equil.psi(1,it); equil.psi_lcfs(it)= equil.psi(end,it); equil.rhopolnorm(:,it) = sqrt(abs((equil.psi(:,it)-equil.psi_axis(it)) ./(equil.psi_lcfs(it)-equil.psi_axis(it)))); + if strcmp(DIAG,'EQR'); + % q value has only a few values and from center to edge, assume they are from central rhopol values on + % But they are every other point starting from 3rd + ijk=find(equil.qvalue(:,it)~=0); + qeff=equil.qvalue(ijk(end:-1:1),it); + rhoeff=equil.rhopolnorm(3:2:2*length(ijk)+1,it); + if length(ijk)>2 + ij_nonan=find(~isnan(equil.rhopolnorm(:,it))); + qfit = zeros(size(equil.rhopolnorm(:,it))); + qfit(ij_nonan)=interpos([0.; rhoeff],[qeff(1) ;qeff],equil.rhopolnorm(ij_nonan,it),-0.01,[1 0],[0 0],[300; ones(size(qeff))]); + else + qfit = zeros(size(equil.rhopolnorm(:,it))); + end + equil.qvalue(:,it) = qfit; + end % get rhotor values equil.phi(:,it) = phi_tree.value(it,Lpf1:-1:1)'; equil.rhotornorm(:,it) = sqrt(abs(equil.phi(:,it) ./ equil.phi(end,it)));