% % [Iiso MASK] = SUBFCT_GETISOS(TRACER,ISO) % % This function determines the iso-surface ISO of the % 3D field TRACER(Z,Y,X) % Iiso(Y,X) contains indices of axis Z of the iso-surface. % MASK(Y,X) contains 1 where the iso-surface is defined % and 0 elsewhere. Useful to plot other fields. % % 06/19/06 % gmaze@mit.edu function varargout = subfct_getisoS(CHP,ISO) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % PRE-PROCESS and ERROR CHECK % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pv_checkpath if nargin ~= 2 help subfct_getisoS.m error('subfct_getisoS.m : Wrong number of parameters') return end [nz ny nx] = size(CHP); if nz ==1 | nx == 1 | ny == 1 help subfct_getisoS.m error('subfct_getisoS.m : 3DFIELD must be a 3D field') return end %%%%%%%%%%%%%%%%%%%%%%%%% % DETERMINE ISO-SURFACE % %%%%%%%%%%%%%%%%%%%%%%%%% mask = ones(ny,nx).*NaN; %isoS = ones(ny,nx).*NaN; Iiso = ones(ny,nx).*NaN; for ix = 1 : nx for iy = 1 : ny p = squeeze(CHP(:,iy,ix)); p = find(p<=ISO); if isempty(p) % isoS(iy,ix) = NaN; Iiso(iy,ix) = NaN; else % isoS(iy,ix) = CHP(max(p),iy,ix); Iiso(iy,ix) = max(p); mask(iy,ix) = 1; end %if end %for ix end %for iy %%%%%%%%%%% % OUTPUTS % %%%%%%%%%%% switch nargout case {0,1} varargout(1) = {Iiso}; case 2 varargout(1) = {Iiso}; varargout(2) = {mask}; end %switch nargout