function z=iscwf(cwf)
%ISCWF Check for valid color weighting function specification

% Part of the OptProp toolbox, $Version: 2.1 $
% Author:  Jerker Wågberg, More Research & DPC, Sweden
% Email: ['jerker.wagberg' char(64) 'more.se']

% $Id: iscwf.m 23 2007-01-28 22:55:34Z jerkerw $

	z=	isstruct(cwf)...
			&& isfield(cwf,'weights') ...
			&&  isfield(cwf,'wl') ...
			&&  isfield(cwf,'whitepoint') ...
		||	ischar(cwf) ...
			&& isilluminant(regexprep(cwf,'/.*$','','once')) ...
			&& isobserver(regexprep(cwf,'^[^/]*/','','once'));
