Skip to main content

Crate snaphu_sys

Crate snaphu_sys 

Source

Structs§

arc_st
Arc
bidircostST
arc cost data structure for bidirectional scalar costs
boundaryST
boundary data structure
bucketST
bucket data structure
bucket_st
bucket
candidateST
arc candidate data structure
conncompsizeST
connected component size structure
costST
arc cost data structure
incrcostST
incremental cost data structure
infileST
input file name data structure
max_align_t
neighborST
boundary neighbor structure
nodeST
node data structure
node_st
node
nodesuppST
supplementary data structure for secondary nodes
outfileST
output file name data structure
paramST
run-time parameter data structure
scndryarcST
secondary arc data structure
smoothcostST
arc cost data structure for smooth costs
tileparamST
tile parameter data structure

Constants§

ABNORMAL_EXIT
ALT_LINE_DATA
ALT_SAMPLE_DATA
ARCUBOUND
ARMLEN
AUTOCALCSTATMAX
BIGGESTDZRHOMAX
BOUNDARYCANDIDATE
BOUNDARYCOL
BOUNDARYLEVEL
BOUNDARYPTR
BOUNDARYROW
BUGREPORTEMAIL
CANDIDATEBAGSTEP
CLIPFACTOR
COMPLEX_DATA
CONNCOMPMEMINCR
CONNCOMPOUTTYPEUCHAR
CONNCOMPOUTTYPEUINT
COPYRIGHT
DEFO
DEF_ALTITUDE
DEF_AMPFILE
DEF_AMPFILE2
DEF_AMPFILEFORMAT
DEF_AMPLITUDE
DEF_ARCMAXFLOWCONST
DEF_ASSEMBLEONLY
DEF_AZDZFACTOR
DEF_AZRES
DEF_BASELINE
DEF_BASELINEANGLE
DEF_BIDIRLPN
DEF_BPERP
DEF_BYTEMASKFILE
DEF_COLCOSTFILE
DEF_COLOVRLP
DEF_CONNCOMPFILE
DEF_CONNCOMPOUTTYPE
DEF_CONNCOMPTHRESH
DEF_CORRDUMPFILE
DEF_CORRFILE
DEF_CORRFILEFORMAT
DEF_COSTINFILE
DEF_COSTOUTFILE
DEF_COSTSCALE
DEF_COSTSCALEAMBIGHT
DEF_CS2SCALEFACTOR
DEF_CSTD1
DEF_CSTD2
DEF_CSTD3
DEF_DA
DEF_DEFAULTCORR
DEF_DEFOAZDZFACTOR
DEF_D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
DEF_PIECENROW
DEF_PRUNECOSTTHRESH
DEF_RANGERES
DEF_RAWCORRDUMPFILE
DEF_REGROWCONNCOMPS
DEF_RHOMINFACTOR
DEF_RHOSCONST1
DEF_RHOSCONST2
DEF_RMTILEINIT
DEF_RMTMPTILE
DEF_ROWCOSTFILE
DEF_ROWOVRLP
DEF_SCNDRYARCFLOWMAX
DEF_SHADOW
DEF_SIGSQCORR
DEF_SIGSQEI
DEF_SIGSQLAYFACTOR
DEF_SIGSQSHORTMIN
DEF_SLOPERATIOFACTOR
DEF_SPECULAREXP
DEF_SRCCOL
DEF_SRCROW
DEF_SYSCONFFILE
DEF_THRESHOLD
DEF_TILECOSTTHRESH
DEF_TILEDIR
DEF_TILEEDGEWEIGHT
DEF_TRANSMITMODE
DEF_UNWRAPPED
DEF_UNWRAPPEDINFILEFORMAT
DEF_VERBOSE
DEF_WEIGHT
DEF_WEIGHTFILE
DOWN
DUMP_COLCOSTFILE
DUMP_CORRDUMPFILE
DUMP_EIFILE
DUMP_FLOWFILE
DUMP_INITFILE
DUMP_MSTCOLCOSTFILE
DUMP_MSTCOSTSFILE
DUMP_MSTROWCOSTFILE
DUMP_PATH
DUMP_RAWCORRDUMPFILE
DUMP_ROWCOSTFILE
FALSE
FLOAT_DATA
GROUNDCOL
GROUNDROW
INBUCKET
INCRCOSTFILENEG
INCRCOSTFILEPOS
INITARRSIZE
INITMAXCOSTINCR
INTERIORLEVEL
KEDGE
LARGEINT
LARGESHORT
LEFT
LOGFILEROOT
MASKED
MAXGROUPBASE
MAXITERATION
MAXLINELEN
MAXNSHORTCYCLE
MAXSTRLEN
MAXTHREADS
MAXTMPSTRLEN
MCFINIT
MINBOUNDARYSIZE
MINSCALARCOST
MSTINIT
NARMS
NEGBUCKETFRACTION
NEGINCR
NEWNODEBAGSTEP
NLISTMEMINCR
NOCOSTSHELF
NORMAL_EXIT
NOSTATCOSTS
NOSTATINITMAXFLOW
NOTINBUCKET
NSOURCELISTMEMINCR
NULLFILE
ONTREE
OPTIONSHELPBRIEF
OPTIONSHELPFULL
PI
PINGPONG
POSBUCKETFRACTION
POSINCR
PROBCOSTP
PROGRAMNAME
PRUNED
REGIONSUFFIX
RIGHT
SECONDSPERPIXEL
SINGLEANTTRANSMIT
SMOOTH
SQRTHALF
TILEDIRMODE
TILEDPSICOLFACTOR
TILEINITFILEFORMAT
TILEINITFILEROOT
TILEOVRLPWARNTHRESH
TMPTILECOSTSUFFIX
TMPTILEDIRROOT
TMPTILEOUTFORMAT
TMPTILEROOT
TOPO
TRUE
TWOPI
UP
USEMAXCYCLEFRACTION
VERSION
VERYFAR
ZEROCOSTARC

Functions§

Add2DFloatArrays
Adds the values of two 2-D arrays elementwise.
AssembleTiles
TODO: comment
BoxCarAvg
Takes in a 2-D array, convolves with boxcar filter of size specified. Uses a recursion technique (but the function does not actually call itself recursively) to compute the result, so there may be roundoff errors.
BucketInsert
TODO: comment
BucketRemove
TODO: comment
BuildCostArrays
Builds cost arrays for arcs based on interferogram intensity and correlation, depending on options and passed parameters.
CAlloc
Allocates zero-initialized memory for an array of elements.
CalcCostDefo
Calculates deformation arc distance given an array of cost data structures.
CalcCostL0
Calculates the L0 arc distance given an array of short integer weights.
CalcCostL0BiDir
Calculates the L0 arc cost given an array of bidirectional cost weights.
CalcCostL1
Calculates the L1 arc cost given an array of bidirectional cost weights.
CalcCostL2
Calculates the L2 arc distance given an array of short integer weights.
CalcCostL1BiDir
Calculates the L1 arc cost given an array of bidirectional cost weights.
CalcCostL2BiDir
Calculates the L2 arc cost given an array of bidirectional cost weights.
CalcCostLP
Calculates the Lp arc distance given an array of short integer weights.
CalcCostLPBiDir
Calculates the Lp arc cost given an array of bidirectional cost weights.
CalcCostNonGrid
Calculates the arc cost given an array of long integer cost lookup tables.
CalcCostSmooth
Calculates smooth-solution arc distance given an array of smoothcost data structures.
CalcCostTopo
Calculates topography arc distance given an array of cost data structures.
CalcFlow
Calculates flow based on unwrapped phase data in a 2D array. Allocates memory for row and column flow arrays.
CalcWrappedAzDiffs
Computes an array of wrapped phase differences in range (across rows). Input wrapped phase array should be in radians. Output is in cycles.
CalcWrappedRangeDiffs
Computes an array of wrapped phase differences in range (across rows). Input wrapped phase array should be in radians. Output is in cycles.
CatchSignals
Traps common signals that by default cause the program to abort. Sets (pointer to function) Handler as the signal handler for all. Note that SIGKILL usually cannot be caught. No return value.
CheckMagMasking
Check magnitude masking to make sure we have at least one pixel that is not masked; return 0 on success, or 1 if all pixels masked.
CheckParams
Checks all parameters to make sure they are valid. This is just a boring function with lots of checks in it.
ClosestNode
TODO: comment
CycleResidue
Computes the cycle array of a phase 2D phase array. Input arrays should be type float ** and signed char ** with memory pre-allocated. Numbers of rows and columns in phase array should be passed. Residue array will then have size nrow-1 x ncol-1. Residues will always be -1, 0, or 1 if wrapped phase is passed in.
Despeckle
Filters magnitude/power data with adaptive geometric filter to get rid of speckle. Allocates 2D memory for ei. Does not square before averaging.
DumpIncrCostFiles
Dumps incremental cost arrays, creating file names for them.
EvalCostDefo
Calculates deformation arc cost given an array of cost data structures.
EvalCostL0
Calculates the L0 arc cost given an array of cost data structures.
EvalCostL0BiDir
Calculates the L0 arc cost given an array of bidirectional cost structures.
EvalCostL1
Calculates the L1 arc cost given an array of cost data structures.
EvalCostL2
Calculates the L2 arc cost given an array of cost data structures.
EvalCostL1BiDir
Calculates the L1 arc cost given an array of bidirectional cost structures.
EvalCostL2BiDir
Calculates the L1 arc cost given an array of bidirectional cost structures.
EvalCostLP
Calculates the Lp arc cost given an array of cost data structures.
EvalCostLPBiDir
Calculates the Lp arc cost given an array of bidirectional cost structures.
EvalCostNonGrid
Calculates the arc cost given an array of long integer cost lookup tables.
EvalCostSmooth
Calculates smooth-solution arc cost given an array of smoothcost data structures.
EvalCostTopo
Calculates topography arc cost given an array of cost data structures.
EvaluateTotalCost
Computes the total cost of the flow array and prints it out. Pass nrow and ncol if in grid mode (primary network), or pass nrow=ntiles and ncol=0 for nongrid mode (secondary network).
ExtractFlow
Given an unwrapped phase array, parse the data and find the flows. Assumes only integer numbers of cycles have been added to get the unwrapped phase from the wrapped pase. Gets memory and writes wrapped phase to passed pointer. Assumes flows fit into short ints.
FlattenWrappedPhase
Given a wrapped phase array and an unwrapped phase array, subtracts the unwrapped data elementwise from the wrapped data and stores the result, rewrapped to [0,2pi), in the wrapped array.
FlipFlowArraySign
Flips the sign of all values in a row-by-column array if the flip flip flag is set. Otherwise, does nothing.
FlipPhaseArraySign
Flips the sign of all values in a passed array if the flip flag is set. Otherwise, does nothing.
Free2DArray
This function frees the dynamically allocated memory for a 2D array. Pass in a pointer to a pointer cast to a void **. The function assumes the array is of the form arr[rows][cols] so that nrow is the number of elements in the pointer array.
Get2DMem
Allocates memory for 2D array.
Get2DRowColMem
Allocates memory for 2D array. The array will have 2*nrow-1 rows. The first nrow-1 rows will have ncol columns, and the rest will have ncol-1 columns.
Get2DRowColZeroMem
Allocates memory for 2D array. The array will have 2*nrow-1 rows. The first nrow-1 rows will have ncol columns, and the rest will have ncol-1 columns. Memory is initialized to zero.
GetNLines
Gets the number of lines of data in the input file based on the file size.
GrowConnCompsMask
Grows contiguous regions demarcated by arcs whose residual costs are less than some threshold. Numbers the regions sequentially from 1. Writes out byte file of connected component mask, with 0 for any pixels not assigned to a component.
GrowRegions
Grows contiguous regions demarcated by arcs whose residual costs are less than some threshold. Numbers the regions sequentially from 0.
InitNetwork
TODO: comment
InitNodeNums
TODO: comment
InitNodes
TODO: comment
IntegratePhase
This function takes row and column flow information and integrates wrapped phase to create an unwrapped phase field. The unwrapped phase field will be the same size as the wrapped field. The array rowflow should have size N-1xM and colflow size NxM-1 where the phase fields are NxM. Output is saved to a file.
IsFinite
This function takes a double and returns a nonzero value if the arguemnt is finite (not NaN and not infinite), and zero otherwise. Different implementations are given here since not all machines have these functions available.
KillChildrenExit
Signal handler that sends a KILL signal to all processes in the group so that children exit when parent exits.
LClip
Clips the input long integer so that it is no less than minval and no greater than maxval, and returns a long integer.
LMin
Return the lesser of two long integers as a long.
LRound
Rounds a floating point number to the nearest integer.
LinInterp1D
Given an array of floats, interpolates at the specified noninteger index. Returns first or last array value if index is out of bounds.
LinInterp2D
Given a 2-D array of floats, interpolates at the specified noninteger indices. Returns first or last array values if index is out of bounds.
LongCompare
Compares two long integers. For use with qsort().
MAlloc
Has same functionality as malloc(), but exits if out of memory.
MCFInitFlows
Initializes the flow on a the network using minimum cost flow algorithm.
MSTInitFlows
Initializes the flow on a the network using minimum spanning tree algorithm.
MakeTileDir
Create a temporary directory for tile files in directory of output file. Save directory name in buffer in paramT structure.
MaskNodes
Set group numbers of nodes to MASKED if they are surrounded by zero-magnitude pixels, 0 otherwise.
MaxNonMaskFlow
Return maximum flow magnitude that does not traverse an arc adjacent to a masked interferogram pixel.
MirrorPad
Returns pointer to 2D array where passed array is in center and edges are padded by mirror reflections. If the pad dimensions are too large for the array size, a pointer to the original array is returned.
NodeResidue
Compute residue of node from wrapped phase. Assumes that memory exists and that row and col are in bounds of the 2-D array of wrapped phase values passed.
NonNegDataArray
Given a 2D floating point array, returns FALSE if any elements are NaN or infinite or negative, and TRUE otherwise.
ParseFilename
Given a filename, separates it into path and base filename. Output buffers should be at least MAXSTRLEN characters, and filename buffer should be no more than MAXSTRLEN characters. The output path has a trailing “/” character.
ProcessArgs
Parses command line inputs passed to main().
ReAlloc
Has same functionality as realloc(), but exits if out of memory.
ReCalcCost
Updates the incremental cost for an arc.
Read2DArray
Reads file of real data of size elsize. Assumes the native byte order of the platform.
Read2DRowColFile
Gets memory and reads single array from a file. Array should be in the file line by line starting with the row array (size nrow-1 x ncol) and followed by the column array (size nrow x ncol-1). Both arrays are placed into the passed array as they were in the file.
Read2DRowColFileRows
Similar to Read2DRowColFile(), except reads only row (horizontal) data at specified locations. tileparams->nrow is treated as the number of rows of data to be read from the RowCol file, not the number of equivalent rows in the orginal pixel file (whose arcs are represented in the RowCol file).
ReadAltLineFile
Read in the data from a file containing magnitude and phase data. File should have one line of magnitude data, one line of phase data, another line of magnitude data, etc. ncol refers to the number of complex elements in one line of data.
ReadAltLineFilePhase
Read only the phase data from a file containing magnitude and phase data. File should have one line of magnitude data, one line of phase data, another line of magnitude data, etc. ncol refers to the number of complex elements in one line of data.
ReadAltSampFile
Reads file of real alternating floats from separate images. Format is real0A, real0B, real1A, real1B, real2A, real2B,… ncol is the number of samples in each image (note the number of floats per line in the specified file).
ReadByteMask
Read signed byte mask value; set magnitude to zero where byte mask is zero or where pixel is close enough to edge as defined by edgemask parameters; leave magnitude unchanged otherwise.
ReadComplexFile
Reads file of complex floats of the form real,imag,real,imag… ncol is the number of complex samples (half the number of real floats per line). Ensures that phase values are in the range [0,2pi).
ReadConfigFile
Read in parameter values from a file, overriding existing parameters.
ReadCorrelation
Reads the correlation information from specified file.
ReadInputFile
Reads the input file specified on the command line.
ReadIntensity
Reads the intensity information from specified file(s). If possilbe, sets arrays for average power and individual powers of single-pass SAR images.
ReadMagnitude
Reads the interferogram magnitude in the specfied file if it exists. Memory for the magnitude array should already have been allocated by ReadInputFile().
ReadUnwrappedEstimateFile
Reads the unwrapped-phase estimate from a file (assumes file name exists).
ReadWeightsFile
Read in weights form rowcol format file of short ints.
SelectSources
Create a list of node pointers to be sources for each set of connected pixels (not disconnected by masking). Return the number of sources (ie, the number of connected sets of pixels).
Set2DShortArray
Sets all entries of a 2D array of shorts to the given value. Assumes that memory is already allocated.
SetBooleanSignedChar
Sets the value of a signed character based on the string argument passed.
SetDefaults
Sets all parameters to their initial default values.
SetDump
Set the global variable dumpresults_global to TRUE if SIGINT or SIGHUP signals recieved. Also sets requestedstop_global if SIGINT signal received. This function should only be called via signal() when a signal is caught.
SetDumpAll
Sets names of output files so that the program will dump intermediate arrays. Only sets names if they are not set already.
SetGridNetworkFunctionPointers
TODO: comment
SetNonGridNetworkFunctionPointers
TODO: comment
SetStreamPointers
Sets the default stream pointers (global variables).
SetTileInitOutfile
Set name of temporary tile-mode output assuming nominal output file name is in string passed. Write new name in string memory pointed to by input.
SetUpDoTileMask
Read the tile mask if a file name is specified in the infiles structure, otherwise return an array of all ones.
SetVerboseOut
Set the global stream pointer sp2 to be stdout if the verbose flag is set in the parameter data type.
SetupIncrFlowCosts
Calculates the costs for positive and negative dflow flow increment if there is zero flow on the arc.
SetupTile
Sets up tile parameters and output file names for the current tile.
SetupTreeSolveNetwork
TODO: comment
Short2DRowColAbsMax
Returns the maximum of the absolute values of element in a two-dimensional short array. The number of rows and columns should be passed in.
SignalExit
Signal handler that prints message about the signal received, then exits.
SolveCS2
SolveCS2 - formerly main()
StrNCopy
Just like strncpy(), but terminates string by putting a null character at the end (may overwrite last character).
StringToDouble
Uses strtod to convert a string to a double, but also does error checking. If any part of the string is not converted, the function does not make the assignment and returns TRUE. Otherwise, returns FALSE.
StringToLong
Uses strtol to convert a string to a base-10 long, but also does error checking. If any part of the string is not converted, the function does not make the assignment and returns TRUE. Otherwise, returns FALSE.
TreeSolve
Solves the nonlinear network optimization problem.
Unwrap
Sets parameters for each tile and calls UnwrapTile() to do the unwrapping.
UnwrapTile
This is the main phase unwrapping function for a single tile.
ValidDataArray
Given a 2D floating point array, returns FALSE if any elements are NaN or infinite, and TRUE otherwise.
WrapPhase
Makes sure the passed float array is properly wrapped into the [0,2pi) interval.
Write2DArray
Write data in a two dimensional array to a file. Data elements are have the number of bytes specified by size (use sizeof() when calling this function.
Write2DRowColArray
Write data in a 2-D row-and-column array to a file. Data elements have the number of bytes specified by size (use sizeof() when calling this function. The format of the array is nrow-1 rows of ncol elements, followed by nrow rows of ncol-1 elements each.
WriteConfigLogFile
Writes a text log file of configuration parameters and other information. The log file is in a format compatible to be used as a configuration file.
WriteOutputFile
Writes the unwrapped phase to the output file specified, in the format given in the parameter structure.
run_main
Entrypoint (main())

Type Aliases§

arc
Arc
bidircostT
arc cost data structure for bidirectional scalar costs
boundaryT
boundary data structure
bucket
bucket
bucketT
bucket data structure
candidateT
arc candidate data structure
conncompsizeT
connected component size structure
costT
arc cost data structure
excess_t
Excess of the node
incrcostT
incremental cost data structure
infileT
input file name data structure
neighborT
boundary neighbor structure
node
node
nodeT
node data structure
nodesuppT
supplementary data structure for secondary nodes
outfileT
output file name data structure
paramT
run-time parameter data structure
scndryarcT
secondary arc data structure
smoothcostT
arc cost data structure for smooth costs
tileparamT
tile parameter data structure
totalcostT
type for total cost of solution (may overflow long)
wchar_t