psfit_options: Options for PSI and FFT based fitting routines

View source: R/psifit.r

psfit_optionsR Documentation

Options for PSI and FFT based fitting routines

Description

Get and optionally set parameters controlling various aspects of PSI algorithms, Zernike polynomial fitting, and data display

Usage

  psfit_options(...)

Arguments

colors

topo.colors(256)

refine

TRUE

puw_alg

"qual"

fringescale

1

wt

NULL

bgsub

TRUE

maxiter

20

ptol

1e-04

trace

1

nzcs

2

zc0

6:7

satarget

c(0, 0)

astig.bath

c(0, 0)

maxorder

14

uselm

FALSE

isoseq

FALSE

usecirc

FALSE

sgs

1

nthreads

parallel::detectCores()/2

plots

TRUE

crop

FALSE

Details

Calling psfit_options with an empty argument list returns the default values of the options used in psifit and wf_net as itemized above. The list can be modified directly or by passing argument value pairs to the function call.

Parameters you might want to change include:

satarget sets the target SA for “numerical nulling.“ This is a vector of length 2 setting the target values of primary and 5th order SA.

ptol sets convergence tolerances for iterative PSI algorithms. These have different definitions and different values may be suitable for different algorithms. A value around 0.01 is appropriate for tiltpsi.

The number of variable Zernike terms in the algorithm tiltpsi is controlled by nzcs. Set it to 3 to include defocus, 5 to include primary astigmatism, 7 to include coma.

maxorder sets the maximum Zernike polynomial order for wavefront fitting. It must be even and at least 6. The default generally produces a good wavefront representation but you may want to experiment with higher order fits.

Parameters isoseq and usecirc control which sets of Zernike (annular) polynomials are called for wavefront fitting. If Zernikes in ANSI/ISO sequence are desired set isoseq = TRUE. The default FALSE uses extended Fringe ordering. Set usecirc = TRUE if you want to use Zernike circle polynomials even for obstructed wavefronts.

puw_alg specifies the phase unwrapping algorithm. Current options are "qual", "brcut", "lpbrcut", and "lp".

A new and somewhat experimental feature from version 3.6.0 of the package is threaded computation of Zernike polynomial matrices. The number of threads used is set with the option nthreads. The default is to use half the number of cores detected because on CPUs that support multi- or hyperthreading the number of cores reported by detectCores() is double the number of physical cores. Setting nthreads = 1 will turn off threading. Different C++ routines are used for the matrix fill in the unthreaded (zpmC) and threaded (zpmCP) cases. Speed improvements, if any, may vary.

If you don't like the default color palette there are many other choices. If you like rainbows rygcb defined in this package produces a relatively perceptually uniform version that's well suited for display on an RGB monitor.

Value

A named list with the current values of the arguments.

Author(s)

M.L. Peck mlpeck54@gmail.com


mlpeck/zernike documentation built on Aug. 21, 2024, 8:32 p.m.