File: PhotopigmentQuantalEfficiency.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (57 lines) | stat: -rw-r--r-- 1,486 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
function quantalEfficiencies = PhotopigmentQuantalEfficiency(receptorTypes,species,source)
% quantalEfficiencies = PhotopigmentQuantalEfficiency.(receptorTypes,[species],[source])
%
% Return estimate of the fraction of absorbed quanta that lead to an isomerization.
%
% Supported types:
%   Any
%
% Supported species:
%		Any.
%
% Supported sources:
% 	Generic (Default).
%   None (returns 1 for all photoreceptor types)
%
% The generic source returns the value 0.667 for any species or type.  This
% is currently the only interesting source implemented.  The value comes from
% Rodieck RW, The First Steps in Seeing, page 472.
%
% 7/25/03  dhb  Wrote it.
% 8/9/13   dhb  Add type of 1.

% Fill in defaults
if (nargin < 2 || isempty(species))
	species = 'Human';
end
if (nargin < 3 || isempty(source))
	source = 'Rodieck';
end

% Fill in specific density according to specified source
if (iscell(receptorTypes))
	quantalEfficiencies = zeros(length(receptorTypes),1);
else
	quantalEfficiencies = zeros(1,1);
end
for i = 1:length(quantalEfficiencies)
	if (iscell(receptorTypes))
		type = receptorTypes{i};
	elseif (i == 1)
		type = receptorTypes;
	else
		error('Argument receptorTypes must be a string or a cell array of strings');
	end

	switch (source)
        case {'None'};
            quantalEfficiencies(i) = 1;
            
		case {'Generic'}
			quantalEfficiencies(i) = 0.667;

		otherwise
			error(sprintf('Unknown source %s for quantal efficiency estimates',source));
	end
end