Home > classes > @ao > phase.m

phase

PURPOSE ^

PHASE overloads the ltpda_phase operator for Analysis objects.

SYNOPSIS ^

function varargout = phase(varargin)

DESCRIPTION ^

 PHASE overloads the ltpda_phase operator for Analysis objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: PHASE overloads the ltpda_phase operator for Analysis objects.
              Uses utils.math.phase() to compute the phase angle.

 CALL:        ao_out = phase(ao_in);
              ao_out = phase(ao_in, pl);

 PARAMETERS:  see help for data2D/applymethod for additional parameters

 M-FILE INFO: Get information about this methods by calling
              >> ao.getInfo('phase')

              Get information about a specified set-plist by calling:
              >> ao.getInfo('phase', 'None')

 VERSION:     $Id: phase.m,v 1.12 2008/09/05 11:15:19 ingo Exp $

 HISTORY:     22-08-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % PHASE overloads the ltpda_phase operator for Analysis objects.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: PHASE overloads the ltpda_phase operator for Analysis objects.
0005 %              Uses utils.math.phase() to compute the phase angle.
0006 %
0007 % CALL:        ao_out = phase(ao_in);
0008 %              ao_out = phase(ao_in, pl);
0009 %
0010 % PARAMETERS:  see help for data2D/applymethod for additional parameters
0011 %
0012 % M-FILE INFO: Get information about this methods by calling
0013 %              >> ao.getInfo('phase')
0014 %
0015 %              Get information about a specified set-plist by calling:
0016 %              >> ao.getInfo('phase', 'None')
0017 %
0018 % VERSION:     $Id: phase.m,v 1.12 2008/09/05 11:15:19 ingo Exp $
0019 %
0020 % HISTORY:     22-08-2007 M Hewitson
0021 %                 Creation
0022 %
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 
0025 function varargout = phase(varargin)
0026 
0027   % Check if this is a call for parameters
0028   if utils.helper.isinfocall(varargin{:})
0029     varargout{1} = getInfo(varargin{3});
0030     return
0031   end
0032 
0033   import utils.const.*
0034   utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0035   
0036   % Collect input variable names
0037   in_names = cell(size(varargin));
0038   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0039 
0040   % Collect all AOs
0041   [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
0042   pl              = utils.helper.collect_objects(varargin(:), 'plist', in_names);
0043 
0044   % Decide on a deep copy or a modify
0045   bs = copy(as, nargout);
0046 
0047   % Combine plists
0048   pl = combine(pl, getDefaultPlist);
0049 
0050   % Apply method to all AOs
0051   applymethod(bs, ao_invars, 'utils.math.phase', pl, getDefaultPlist, getInfo);
0052 
0053   % Reshape the ouput to the same size of the input
0054   if nargout > 0
0055     varargout{1} = bs;
0056   end
0057 end
0058 %--------------------------------------------------------------------------
0059 % Get Info Object
0060 %--------------------------------------------------------------------------
0061 function ii = getInfo(varargin)
0062   if nargin == 1 && strcmpi(varargin{1}, 'None')
0063     sets = {};
0064     pl   = [];
0065   else
0066     sets = {'Default'};
0067     pl   = getDefaultPlist;
0068   end
0069   % Build info object
0070   ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: phase.m,v 1.12 2008/09/05 11:15:19 ingo Exp $', sets, pl);
0071 end
0072 
0073 %--------------------------------------------------------------------------
0074 % Get Default Plist
0075 %--------------------------------------------------------------------------
0076 function pl = getDefaultPlist()
0077   pl = plist('axis', 'y');
0078 end
0079 
0080 % END

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003