psifit: Phase Shifting Interferometry

View source: R/psifit.r

psifitR Documentation

Phase Shifting Interferometry

Description

High level function for Least squares analysis of phase shifted interferograms.

Usage

psifit(images, phases, cp = NULL, satarget = NULL, psialg = "ls", options = psfit_options())

Arguments

images

An array containing the interferogram images

phases

A vector of phase shifts

cp

A list describing the pupil boundary, as returned by pupil.pars

satarget

Target 4th and 6th order SA coefficients in non-null tests of aspheres

psialg

String identifying the PSI algorithm to use

options

a list of options

Details

images is a 3 dimensional array with dimensions nrow x ncol x length(phases), where nrow and ncol are the number of rows and columns in the individual interferogram images.

The current values recognized for psialg are

ls

least squares with known phase shifts

aia

the “advanced iterative algorithm“ aiapsi

pc1

pca with pcalg="pc1"

pc2

pca with pcalg="pc2"

pc3

pca with pcalg="pc3"

gpc

my generalized PC algorithm in gpcapsi

pc1thenaia

first pcapsi then aiapsi

gpcthentilt

first gpcapsi then tiltpsi

tilt

tiltpsi

Value

A list with the following components

phi

wrapped phase estimate

mod

modulation estimate

phases

phase shifts

cp

the interferogram boundary

wf.net

net, unfiltered wavefront (see wf_net)

wf.smooth

Zernike fit wavefront

wf.residual

the difference

fit

Coefficients of Zernike fit to wavefront

zcoef.net

Net Zernike coefficients

extras

any extra data returned by low level functions

Author(s)

M.L. Peck mlpeck54@gmail.com

See Also

lspsi, aiapsi, tiltpsi, gpcapsi, pcapsi

Examples

  ## reuse the files from the demo for an example of two stage fitting
  ## using gpca then tiltpsi
require(zernike)
fpath <- file.path(find.package(package="zernike"), "psidata")
files <- scan(file.path(fpath, "files.txt"), what="character")
for (i in 1:length(files)) files[i] <- file.path(fpath, files[i])

# load the images into an array

images <- load.images(files)

# parameters for this run

source(file.path(fpath, "parameters.txt"))

# phase shifts

phases <- wrap((0:(dim(images)[3]-1))/frames.per.cycle*2*pi)
phases <- switch(ps.dir, ccw = -phases, cw = phases, phases)

# target SA coefficients for numerical null.

sa.t <- sconic(diam,roc,lambda=wavelength)
zopt <- psfit_options()
zopt$satarget <- sa.t
zopt$ptol <- 0.01
tfit <- psifit(images, phases, psialg="gpcthentilt", options=zopt)

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