File: RetIrradiancePerAreaAndEyeLengthToRetIrradiancePerDegrees2.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 (31 lines) | stat: -rw-r--r-- 1,434 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
function retIrradiance_PerDegrees2 = RetIrradiancePerAreaAndEyeLengthToRetIrradiancePerDegrees2(retIrradiance_PerArea,eyeLength)
% retIrradiance_PerDegrees2 = RetIrradiancePerAreaAndEyeLengthToRetIrradiancePerDegrees2(retIrradiance_PerArea,eyeLength)
%
% Convert retinal irradiance measured in units of Y/x^2 to units of
% Y/deg^2, where x is a unit of distance (m, cm, mm, um, etc.) and
% Y is a measure of light amount (Watts, Joules, quanta/sec, quanta, etc.)
%
% Eye length should be passed in units of x.
%
% The conversion assumes that we are in the small angle regime, where
% degrees are essentially linear with retinal extent.
%
% See also: PsychRadiometric, RetIrradiancePerDegrees2AndEyeLengthToRetIrradiancePerArea.
%
% 6/23/13  dhb  Wrote it.

% Convert x to degrees.  The routine RetinalMMToDegrees does not
% actually care whether the input is in mm, it just needs its
% two arguments to be in the same units.
%
% We use DegreesToRetinalMM and invert it, rather than RetinalMMToDegrees.
% This is because with the former, we can force the number of degrees to be small
% and get a factor valid in the small angle range.  If we do it the
% other way, when the units of distance are large relative to the 
% eye length, weird things can happen.
xPerDegree = DegreesToRetinalMM(1,eyeLength);
degreesPerX = 1/xPerDegree;
degrees2PerArea = degreesPerX^2;

retIrradiance_PerDegrees2 = retIrradiance_PerArea/degrees2PerArea;