brcutpuw | R Documentation |
brcutpuw
implements a branch cut algorithm for phase unwrapping
brcutpuw(phase, pen = 0, details = FALSE, trace = 1) netflowpuw(phase, wts = NULL, details = FALSE, trace = 1)
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 ( |
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 |
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.
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.
brcutpuw
: Branch cut algorithm for phase unwrapping
netflowpuw
: Network flow algorithm for phase unwrapping
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.
There is a function with the same name brcutpuw
in package zernike.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.