brcutpuw: Linear program based phase unwrapping

View source: R/brcutpuw.r

brcutpuwR Documentation

Linear program based phase unwrapping

Description

brcutpuw implements a branch cut algorithm for phase unwrapping

Usage

brcutpuw(phase, pen = 0, details = FALSE, trace = 1)

netflowpuw(phase, wts = NULL, details = FALSE, trace = 1)

Arguments

phase

matrix with phase map to be unwrapped (phases are in radians)

pen

penalty for making a branch cut from a residue to an edge (brcutpuw only)

details

Return some details of the solution?

trace

Send some info from the LP solver to the console?

wts

matrix of weights for cost function with same dimension as phase (netflowpuw only)

Details

This package implements two distinct algorithms for two dimensional phase unwrapping that can be set up and solved as general linear programs. The linear programs are solved using the LP solver CBC from COIN-OR using the interface provided by the package rcbc.

Value

The unwrapped wavefront in units of fringes. If details is TRUE additional details of the solution are returned in a named list with the first member puw containing the unwrapped wavefront.

Functions

  • brcutpuw: Branch cut algorithm for phase unwrapping

  • netflowpuw: Network flow algorithm for phase unwrapping

Note

According to the documentation for rcbc different levels of detail from the LP solver can be printed with trace levels up to 15, however the same output seems to be returned for all values. Setting trace=0 will produce silent output, which may not be advisable since these can take some time to run.

The value of trace doesn't matter when running in a Windows "GUI" console window or Rstudio because the CBC output isn't passed. If you want to see some output run in a terminal window instead.

See Also

There is a function with the same name brcutpuw in package zernike.

Examples

  data("phasemaps", package="lppuw")
  mtext(zernike::rmap(phi, plot=TRUE))
  wf.bc <- lppuw::brcutpuw(phi)
  X11()
  zernike::plot.pupil(wf.bc, col=zernike::rygcb(400))
  mtext("Unwrapped wavefront from branch cut algorithm")
  wf.nf <- netflowpuw(phi, mod)
  X11()
  zernike::plot.pupil(wf.nf, col=zernike::rygcb(400))
  mtext("Unwrapped wavefront from network flow algorithm")
  cat("Summary of the difference between the two unwrapped wavefronts:\n")
  zernike::summary.pupil(wf.nf - wf.bc)


mlpeck/lppuw documentation built on April 21, 2022, 2:52 a.m.