Home > ISET > vcamera > optics > opticsGet.m

opticsGet

PURPOSE ^

Get optics parameters (some values are stored but many are computed)

SYNOPSIS ^

function val = opticsGet(optics,parm,varargin)

DESCRIPTION ^

 Get optics parameters (some values are stored but many are computed)

      val = opticsGet(optics,parm,varargin)

 The optics parameters are stored in two different groups of fields.

 There are three types of optics models, of increasing complexity. The
 method in use can be selected by the popup menu in the optics window.
 The method is selected by the parameter opticsSet(optics,'model',parameter);

 (1) By default, we use a diffraction limited calculation with the
 f-number and focal length determined from the window interface.  Other
 parameters are derived from these few values.  In this case, the optical
 image is computed using oiCompute. To set this method, use
 opticsSet(optics,'model','diffractionLimited');

 (2) We can use shift-invariant calculation based on a numerically-defined
 OTF that is wavelength-dependent (but shift-invariant), stored in the
 optics.OTF structure.  When using this method, the user must supply the
 optics structure containing the OTF and other parameters (focal length,
 aperture, and so forth).  Examples are stored in ISET-Data\optics
 directory.  In this case, the optical image is computed using the
 function opticsSICompute.  To set this method use
 opticsSet(optics,'model','shiftInvariant');

 (3) We allow a shift-variant optics model based on ray tracing
 calculations.  In this case, the optics model includes geometric
 distortions, relative illumination and spatially-varying blurring
 calculated using ray tracing programs, such as Code V and Zemax.  The
 geometric distortions, relative illumination, and point spread parameters
 are stored in optics.rayTrace structure. In this case, the optical image
 is computed using the function opticsRayTrace.  To set this method use
 opticsSet(optics,'model','rayTrace')

 About the calculations and PSF
  We store the OTF data with DC at (1,1).  This is true throughout ISET.
  To understand the implications for certain calculations see the script
  and tutorial in s_FFTinMatlab.

  Although Matlab uses this representation, when we make graphs and
  images we put the center of the image at the center -- of course -- and
  we also put the DC value of the OTF in the middle of the image.  Hence,
  when we return the frequency support or the spatial support we create
  values for frequencies that run from negative to positive.  Similarly,
  when we compute the spatial support we create spatial samples that run
  below and above zero.

 Example:
   NA = opticsGet(optics,'na');
   rt = opticsGet(optics,'rayTrace');
   psf = opticsGet(optics,'rtPSF',500);     % Shift-variant ray trace
   psf = opticsGet(optics,'psfData',400);   % Shift invariant data
   otf = opticsGet(optics,'otfdata',450);   % MTF
      mesh(abs(otf));
   otfSupport = opticsGet(optics,'otfSupport','mm');  % Cycles/mm
      mesh(otfSupport{1},otfSupport{2},abs(otf))

 Optics parameters

   '*' means that you can use the syntax opticsGet(optics,'parm','unit'),
   such as  opticsGet(optics,'focalLength','mm')

      {'name'}    - name for these optics
      {'type'}    - always 'optics'
      {'model'}   - Type of optics computation,
                    diffractionLimited, rayTrace, or shiftInvariant.
      {'fnumber'}            - f#, ratio of focal length to aperture,
                               a dimensionless quantity.
      {'effectivefnumber'}   - effective f-number
      {'focallength'}        - focal length (M)
      {'power'}              - optical power in diopters (1/f),units 1/M
      {'imagedistance'}      - image distance from lensmaker's equation
      {'imageheight'}*       - image height
      {'imagewidth'}*        - image width
          opticsGet(optics,'imagewidth',10,'mm')
      {'imagediagonal'}*     - image diagonal size
      {'numericalaperture'}  - numerical aperture
      {'aperturediameter'}*  - aperture diameter
      {'apertureradius'}*    - aperture radius
      {'aperturearea'}*      - aperture area
      {'magnification'}      - optical image magnification (<0 inverted)
      {'pupilmagnification'} -

 Off-axis methods and data
      {'offaxismethod'}      - custom relative illumination method
      {'cos4thmethod'}       - default cos4th method
      {'cos4thdata'}         - place to store cos4th data

 OTF information   - Used for shift-invariant calculations
      {'otfmethod'}      - method for computing the OTF; dlmtf, custom
      {'otfdata'}        - the optical transfer function data
      {'otfsize'}
      {'otffx'}          - column (fx) samples of OTF data
      {'otffy'}          - row (fy) samples of OTF data
      {'otfsupport'}     - cell array, val{1:2}, of fy,fx samples
      {'otfwave'}        - wavelength samples of the otf data
      {'otfbinwidth'}    - difference between wavelength samples
      {'psfdata'}        - psf data, calculated from the stored otfdata
      {'psfspacing'}
      {'psfsupport'}
      {'incoherentcutoffspatialfrequency'}*    - Vector of incoherent cutoff freq
                                                 for all wavelengths
      {'maxincoherentcutoffspatialfrequency'}* - Largest incoherent cutoff

 Wavlength information
      {'spectrum'}         - wavelength information
        {'wavelength'}     - wavelength samples
        {'nwave'}          - number of wavelength samples
        {'binwidth'}       - spacing between the samples
      {'transmittance'}    - wavelength transmission function

  Ray Trace information - Used for non shift-invariant calculations
      {'rtname'}        - name, may differ from file because of processing
      {'raytrace'}      - structure containing ray trace information
      {'rtopticsprogram'}     - 'zemax' or 'code v'
      {'rtlensfile'}          - Name of lens description file
      {'rteffectivefnumber'}  - Effective fnumber
      {'rtfnumber'}           - F-number
      {'rtmagnification'}     - Magnification
      {'rtreferencewavelength'}    - Design reference wavelength (nm)
      {'rtobjectdistance'}*        - Design distance to object plane
      {'rtfieldofview'}            - Diagonal field of view (deg)
      {'rteffectivefocallength'}*  - Effective focal length
      {'rtpsf'}               - structure containing psf information
        {'rtpsfdata'}            - psf data
                opticsGet(optics,'rtpsfdata')
                opticsGet(optics,'rtpsfdata',fieldHeight,wavelength)
        {'rtpsfsize'}            - (row,col) of the psf functions
        {'rtpsfwavelength'}      - sample wavelengths of psf estimates
        {'rtpsffieldheight'}*    - field heights for the psfs
        {'rtpsfsamplespacing'}*  - sample spacing between psfs
        {'rtpsfsupport'}*        - spatial position (2D) of the psf functions
        {'rtpsfsupportrow'}*     - spatial position of row samples
        {'rtpsfsupportcol'}*     - spatial position of col samples
        {'rtotfdata'}            - OTF derived from PSF ray trace data  *** (NYI)
      {'rtrelillum'}       - structure containing relative illumination information
        {'rtrifunction'}       - Relative illumination function
        {'rtriwavelength'}     - Wavelength samples (nm)
        {'rtrifieldheight'}*   - Field heigh values
      {'rtgeometry'}       - structure containing geometric distortion information
        {'rtgeomfunction'}         - Geometric distortion function
               opticsGet(optics,'rtgeomfunction',[],'mm')
               opticsGet(optics,'rtgeomfunction',500)
        {'rtgeomwavelength'}       - Wavelength samples (nm)
        {'rtgeomfieldheight'}*     - Field height samples
        {'rtgeommaxfieldheight'}*  - Maximum field height sample

 Computational parameters
       {'rtComputeSpacing'}*      - Sample spacing for PSF calculation

 Copyright ImagEval Consultants, LLC, 2005.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 14-Jan-2007 10:24:23 by m2html © 2003