pupil: Pupils and wavefronts

View source: R/pupil.r

pupilR Documentation

Pupils and wavefronts

Description

Create a pupil object and optionally fill it with a wavefront. For our purposes a “pupil” is defined to be a matrix representation of a circular or annular aperture. Simple plot and summary methods are also provided.

Usage

  nrow.default <- 640
  ncol.default <- nrow.default
  cp.default <- list(xc=320.5, yc=320.5, rx=319.5, ry=319.5, obstruct=0)

  pupil(zcoef=NULL, maxorder=14L, isoseq=FALSE,
      phi=0, piston=NULL,
      nrow=nrow.default, ncol=ncol.default, 
      cp=cp.default)
  pupil.arb(zcoef=NULL, zlist=makezlist(), 
          phi=0, piston=0,
          nrow=nrow.default, ncol=ncol.default, 
          cp=cp.default)

Arguments

zcoef

A vector of Zernike coefficients

maxorder

Maximum Zernike polynomial order

zlist

List of indexes the same length as zcoef

isoseq

ZPs in ISO/ANSI sequence

phi

Amount to rotate image, in degrees

piston

Constant to add to wavefront values

nrow

Number of rows in output matrix

ncol

Number of columns in output matrix

cp

A list with items xc - x coordinate of central pixel, yc - y coordinate of central pixel, rx - x radius in pixels, ry - y radius in pixels, obstruct - central obstruction fraction.

Details

plot.pupil and summary.pupil provide simple plot and summary methods for objects of class "pupil".

pupil.arb will accept an arbitrary list of Zernike indexes.

pupil requires a complete set of Zernikes as returned by zpm or zpm_cart.

Default values nrow.default, ncol.default and cp.default are now (as of version 3.7.0) stored in the package environment. These can be used or overridden by setting values in the user's global environment.

Version 3.7.0 of this package makes some fairly significant changes in pupil from previous releases. First, zlist is no longer used to indicate the set of Zernikes used. Instead the maximum radial order is passed as maxorder, defaulting to 14. The complete set of Zernike polynomial values including piston is calculated with either zpm or zpm_cart if isoseq is TRUE. The vector zcoef, if non-null, must be either the same length as the number of columns in the zernike matrix with a null value for piston, or one shorter with a non-null value for piston. The vector zcoef.net returned by wf_net has the first, piston, element removed so a non-null piston value must be passed as an argument.

Value

A matrix of size nrow x ncol. The matrix is assigned to the class "pupil". NAs are used to fill the matrix outside the defined area of the pupil.

Note

The parameter cp is used to define the dimensions of the pupil. See pupil.pars for details.

Author(s)

M.L. Peck mpeck1@ix.netcom.com

See Also

zpm, zpm_cart, wf_net, pupilrms, pupilpv, strehlratio, pupil.pars, circle.pars.

Examples

wf <- pupil(zcoef=rnorm(length(makezlist(0, 14)$n), 0, 0.01))
plot(wf, addContours=FALSE)
summary(wf)

mlpeck/zernike documentation built on April 19, 2024, 3:16 p.m.