% This funtion builds the allowable probe names in the range requested, and % returns the list of probe names. (Automatically skips dead probes if a shot number is given) function result = build_hitsi_probe_name(cone, axloc, winding, azimuth, varargin) %#ok global deadProbes %L,S 01-8/10 N,P,T 000-360deg shot if(length(varargin)==1) shot_num = varargin{1}; mdsconnect('landau.hit'); mdsopen('hitsi',shot_num); deadProbes = mdsvalue('\dead_probes'); mdsclose; mdsdisconnect; else deadProbes = []; end result = []; if strcmpi(cone,'ALL') > 0 cone=['L','S']; end if strcmpi(winding,'ALL') > 0 winding=['N','P','T']; end for i=1:length(cone) if(strcmpi(axloc,'ALL') > 0) if(strcmpi(cone(i),'L')>0) axlocn = 1:10; else axlocn = 1:8; end else if strcmpi(axloc,'GAP') if strcmpi(cone(i),'L')>0 axlocn = 5:6; else axlocn = []; end else axlocn1 = double(axloc); if axlocn1(1) > 47 %Being fed numbers in char format (e.g., '05') axlocn = []; for m = 1:length(axloc(:,1)) axlocn(m) = str2num(axloc(m,:)); end else %Being fed numbers in a matrix of some sort) axlocn = axloc; end end end for j=1:length(axlocn) if(strcmpi(azimuth,'ALL') > 0) if (((axlocn(j) == 5) || (axlocn(j) == 6)) && (strcmpi(cone(i),'L') > 0)) x = 0:15; azimuthn=floor(22.5*x); else azimuthn=[0,45,180,225]; end elseif azimuth(1) > 47 azimuthn = str2num(azimuth); else azimuthn = azimuth; end for m=1:length(winding) for n=1:length(azimuthn) Probe_Name = [cone(i),num2str(axlocn(j),'%2.2d'),winding(m),num2str(azimuthn(n),'%2.3d')]; if ~isDeadProbe(Probe_Name) result=[result;Probe_Name];%#ok %format='(a,i2.2,a,i3.3)'); end end end end end %% Helper function - checks to see if a probe is dead. function isDead = isDeadProbe(Probe_Name) global deadProbes isDead = 0; % deadProbes = {'L01P045','S04P000','L07P180','S05T000'}; for i = 1:length(deadProbes) if strcmpi(deadProbes{i},Probe_Name) isDead = 1; return; end end return;