~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychRadiometric/RadianceAndPupilAreaEyeLengthToRetIrradiance.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function retIrradiance_PowerPerArea = RadianceAndPupilAreaEyeLengthToRetIrradiance(radiance_PowerPerAreaSr,radianceS,pupilArea,eyeLength)
 
2
% retIrradiance_PowerPerArea = RadianceAndPupilAreaEyeLengthToRetIrradiance(radiance_PowerPerAreaSr,radianceS,pupilArea,eyeLength)
 
3
%
 
4
% Perform the geometric calculations necessary to convert a measurement of source
 
5
% radiance to corresponding retinal irradiance. 
 
6
%
 
7
% Let x be the units of distance (m, cm, mm, um, etc.)
 
8
%
 
9
%   Input radiance_PowerPerAreaSr should be in units of power/x^2-sr-wlinterval.
 
10
%   Input radianceS gives the wavelength sampling information (nm).
 
11
%   Input pupilArea should be in units of x^2.
 
12
%   Input eyeLength should be the length of the eye in units of x
 
13
%
 
14
%   Output retIrradiance_PowerPerArea is in units of power/x^2-wlinterval.
 
15
%
 
16
%   Light power may be expressed in watts or quanta-sec or in your
 
17
%   favorite units.  Indeed, it may also be passed as energy rather
 
18
%   than power.  
 
19
%
 
20
% This conversion does not take absorption in the eye into account,
 
21
% as this is more conveniently foldeded into the spectral absorbtance.
 
22
%
 
23
% See also: PsychRadiometric, RetIrradianceAndPupilAreaEyeLengthToRadiance, PupilAreaFromLum, EyeLength.
 
24
%
 
25
% 3/6/13  dhb  Wrote it.
 
26
 
 
27
% Define factor to convert radiance spectrum to retinal irradiance
 
28
% Commented out code shows the logic, which is short circuited by actual code.
 
29
% but is conceptually convenient for doing the calculation.
 
30
%  distanceToSource = 100;
 
31
%  fractionfSphere = pupilArea/4*pi*distanceToSource^2;
 
32
%  pupilAreaSR = 4*pi*fractionOfSphere;
 
33
%  sourceArea = (distanceToSource^2)/(eyeLength^2);
 
34
%  conversionFactor = pupilAreaSR*sourceArea;
 
35
conversionFactor = pupilArea/(eyeLength^2);
 
36
retIrradiance_PowerPerArea = conversionFactor*radiance_PowerPerAreaSr;