Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase...

30
Theory and prac-ce of phase unwrapping Rob Mellors, Eric Lindsey, Xiaohua (Eric) Xu, Kurt Feigl § What is phase unwrapping? § Ways to unwrap § Using SNAPHU in GMTSAR § Reduce or avoid the problem LLNL-PRES-XXXX This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under contract DE-AC52-07NA27344. Lawrence Livermore National Security, LLC GMTSAR Short Course, UCSD, Aug. 16-18, 2017

Transcript of Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase...

Page 1: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

Theoryandprac-ceofphaseunwrappingRob Mellors, Eric Lindsey, Xiaohua (Eric) Xu, Kurt Feigl

§  What is phase unwrapping? §  Ways to unwrap §  Using SNAPHU in GMTSAR §  Reduce or avoid the problem

LLNL-PRES-XXXX This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under contract DE-AC52-07NA27344. Lawrence Livermore National Security, LLC

GMTSARShortCourse,UCSD,Aug.16-18,2017

Page 2: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

overviewofunwrappingGivenaninterferogram(s)

-usuallyneedtoconvertphasetousefulunits-weshouldknowradarwavelengthandgeometry

Usuallyrequiresunwrapping-unwrappingnotalwayseasyorfast

Twopopularalgorithms-Goldstein-SNAPHU(ChenandZebker,2000)-othersexist!(global,gradient,etc)

Saudi 7/1/08-8/19/08 ALOS Bperp 20 m

Page 3: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

SenKnel,ascending&descending

Page 4: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

Anexampleofpoorunwrapping

Page 5: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

extrac-ngthephaseWecangetonlythewrappedphase*Φ(t)=arctan(I(s(t)),R(s(t)))where–π<Φ(t)<πWewouldliketheconKnuousphase.Thisappearssimple.Lookfor2πjumpsandthenaddtheappropriatemulKpleof2π.

Ifthedataaregood,phaseunwrappingisstraighIorward• WecouldtakederivaKveincomplexversion(e.g.Sandwell&Price)

Page 6: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

phaseunwrappingAssumethatwehavetwosignalstakenatdifferentKmes:g1=a1exp(i4πR1/λ)g2=a2exp(i4πR2/λ)a1,a2=amplitudeR1,R2israngefromantennatosurfaceλ=wavelengthAtagivenpoint,assumea1=a2=a(g1)(g2*)=(a2)exp[i4π(R1-R2)]=s(t)ThephaseofthisfuncKonisproporKonaltotheeffecKve

differenceinrange,whichinturndependsonsatellitegeometry,topography,atmosphere,soilmoisture,ormaybeevendeforma-on.

WanttofindthefuncKon,that,whenwrapped,matchesthedata

Page 7: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

problems:aliasingand/ornoise

AliasingTruephasechangesbymorethan1cycle(2πradians)betweensamples.Causedbylargebaselines,steeptopographyorlargedeformaKon(steepphasegradient)

NoiseordatagapsChangesonthesurface(e.g.,vegetaKon,snow,erosion)maycausethetwoimagestode-correlate,introducingnoise

Page 8: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

iden-fyingandresolvingproblems

1)  Maskoutareasofpoordata.1)  UsecorrelaKonasaguide(maskoutallpixelswith

correlaKonlessthanathresholdvalue)2)  IdenKfypointsofinconsistentdata(residues)

2)  Filtertoreduceproblems.3)  Usemodeltosubtractexpectedphase.

correlaKon phase

Page 9: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

filtering

sta0c-usuallylowpass- convolvewithsetoffiltercoefficients(boxcar,Gaussian,etc)- detrend(detrend_before_unwrap.csh)

adap0ve- GoldsteinandWerner[1998]spectralfilter.- effecKvebut“cansignificantlychangethestructureoftheinterferogram”[Baranetal,2003]

objecKve:improvesignal-to-noiseoffringespriortounwrapping

Page 10: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

adap-vefilter- filter parameter vary depending of properties of each patch

H(u,v) = (S{|Z(u,v)|}a )(Z(u,v))

Z(u,v) Fourierspectrumofsmall2Dpatchofcomplexinterferogram(perhaps32by32pixels)S smoothing(e.g.3by3pixels)H outputa exponent(a=0,nofilter,a>0filters)- takeFourierofsmallpatch(32by32pixels)- raisespectrumtopower- inverseFFT- resultsdependsonnoiseandphase!- Baranetal[2003]usea=1–γwhereγisthecoherence

(filteralsodevelopedbyGoldstein)

Page 11: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

adap-vefilterinGMTSAR

phasefilt•  readsinrealandimaginaryfiles(imag.grdandreal.grd)•  alpha=exponentforfilter(defaultis0.5;between0.0and1.5)•  psize=patchsize(usually16or32)•  CandefinealphawithcorrelaKonalso

Runbyfilter.cshFilter.cshrunbyp2p*.cshscriptscreatesphasefilt.grd(phasefiltmakesfiltphase.grdwhichisflippedwithgrdmathtocreatephasefilt.grd)

phasefilt-imagimagfilt.grd-realrealfilt.grd-amp1amp1.grd-amp2amp2.grd-psize16

Page 12: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

Nofilter

phasefilter,psize=32

alpha=0.5

alpha=1.5

wrapped unwrapped wrapped unwrapped

M6.1 2017-04-0506:09:12UTC35.776°N60.436°E13.0kmdepthSenKnelP13,F112P93,F472

effectsofadap-vefilter

Page 13: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

localunwrapping(pathfollowing)

Similartothe1Dapproach1.)Calculatethedifferencesofthewrappedphase.2.)Wrapthedifferences.3.)Setthevalueofthefirstvalue.3.)Integratealongallvalues.

Dothisalongalinethroughout2Darea(inazigzagbackandforthalongtherows,forexample)Worksgreatifthereisnonoise.Withnoise:

1)Anerrornearthestartofthepathpropagatesalongthewholepath.

2)Answermayvarywithpath.3)NeedtoidenKfybadpixels.How?

Page 14: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

Phaseshouldreflectthetopography.WeknowthattopographicsurfacesareconservaKve• Anypointsthatviolatethisruleshouldbeavoided.• Thesepointsareknownasresidues.• AnyintegraKonpaththatcirclesaresiduewillcontainerrors=>needtomake“branchcuts”• Aresidueisapropertyofphasedifferences,notasinglepixel.• canbeposiKveornegaKve• CanbeidenKfiedbyexamininggroupsofpixels

iden-fyinginconsistentdata

Page 15: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

wrapped differences should sum to zero around a loop. If sum is not zero, then identify the loop as a residue.

phase could be unwrapped by simply integrating wrappedphase differences, or gradients, along any path from pixelto pixel throughout the interferogram. While this as-sumption is indeed correct for most parts of an interfero-gram, even the most mundane of interferograms may con-tain many phase gradients that are greater than one-halfcycle. Moreover, as we integrate from pixel to pixel, theinclusion of an erroneous phase gradient value causes allsubsequent pixels to be in error. Thus, if handled im-properly, phase gradients greater than one-half cycle maycause large-scale errors that affect whole regions of theinterferogram.

The task of a phase unwrapping algorithm, then, re-duces to locating gradients that are greater than one-halfcycle: these gradients are called discontinuities. Mostalgorithms locate discontinuities by posing the phase un-wrapping problem as a constrained optimization problemwhose solution exactly or approximately minimizes thevalue of some objective function. Such a function mapsparticular unwrapped phase fields to scalar values ac-cording to some criterion, called the objective, for compar-ing the desirability of possible solutions. Least-squaresalgorithms implicitly locate discontinuities by minimizingthe squared difference between unwrapped and wrappedphase gradients.12,15–17 On the other hand, the residue-cut algorithm of Goldstein et al.10 and the minimum costflow (MCF) algorithms suggested by Costantini8 andFlynn9 use ‘‘path-following’’ approaches that expresslyidentify and accommodate discontinuities during directintegration of phase gradients. Such approaches aresometimes referred to as local rather than global because,as described below, they use only local information ateach step to approach globally optimal solutions for theirrespective objective functions. We draw heavily fromthese algorithms, so we briefly outline them here.

In a properly unwrapped phase field, the integral of un-wrapped gradients around a closed loop should always bezero. In a wrapped phase field, however, a true gradientgreater than one-half cycle will be wrapped to a differentvalue, causing the results of some closed path integrals tobe nonzero integers. This property was used by Gold-stein et al.10 to locate discontinuities. Wrapped phasegradients are integrated in loops for each 2 ! 2 square ofpixels in the interferogram, resulting in 1, 0, or "1. Non-zero results are called residues or charges, and they indi-cate the presence of inconsistencies with respect to the as-sumption that wrapped phase gradients are less thanone-half cycle. Moreover, integration paths encirclingunbalanced numbers of positive and negative residuesalso contain such inconsistencies. To avoid such paths,‘‘cuts’’ are grown in a treelike manner throughout the in-terferogram such that every charge is on a neutral tree,where a tree is simply a set of connected cuts. Phase in-tegration paths are then disallowed from crossing overany cuts, so no paths encircle unbalanced charge. Con-sequently, along these paths, phase gradients may be in-tegrated under the assumption that they are less thanone-half cycle. Cuts therefore represent possible loca-tions of discontinuities. Although an attempt is made tominimize the total length of cuts in the scene, the exactminimum of this quantity generally cannot be attained.Still, the residue-cut algorithm is fast and often quite ac-

curate. In its original implementation, however, cuts areable to close on themselves, so a solution may suffer aslarge areas of the interferogram are closed off from otherareas, causing the unwrapping to be incomplete.

MCF algorithms are similar to the residue-cut algo-rithm in that they connect positive and negative residues,but they do so guided by a different minimization objec-tive. The first MCF approach can be attributed toFlynn,9 although the framework suggested by Costantini8

generalizes considerably the formulation of the phase un-wrapping problem. Under this framework, the phase un-wrapping problem itself is equated with a general net-work flow problem, allowing the interchangeable use offast existing network optimization routines as well asmany other ideas in the rich and well-developed area ofnetwork theory. Here we treat Flynn’s algorithm as aspecific implementation of the general MCF approach.

With both the MCF and the residue-cut approaches,the unwrapped phase, when rewrapped, is identical to theoriginal wrapped phase; indeed, phase unwrapping maybe viewed as the process of finding the integer numbers ofcycles which, when added to the wrapped phase values,result in a residue-free unwrapped solution. Equiva-lently, one may find the numbers of extra cycles added tothe wrapped phase gradients rather than to the phasevalues themselves; it is the total number of these extragradient cycles that an MCF algorithm seeks to minimize,not the total cut length as in the residue-cut algorithm.The two objectives differ because cuts may have zero ormultiple extra cycles of phase across them.

The general MCF minimization problem is solved withnetwork flow techniques with use of a model like the onein Fig. 1. Each 2 ! 2 residue loop integral is repre-sented by a node whose surplus equals the value of theintegral (1, 0, or "1, with negative surpluses being de-mands). Directed arcs, or possible flow paths, connectneighboring nodes and are consequently associated withphase gradients in the original data. Flow on a particu-lar arc physically represents the difference in cycles be-tween its associated unwrapped and wrapped phase gra-dients. The problem is constrained so that flow must beconserved at all nodes, meaning that the net flow out of anode (flow out minus flow in) must be equal to the node’s

Fig. 1. Example network equivalent of the phase unwrappingproblem. The numbers represent the 2-D array of phasesamples (normalized to one cycle). Each 2 ! 2 clockwise loopintegral of wrapped phase gradients is a node in the network,and positive and negative residues result in supply and demandnodes. Neighboring nodes are connected by arcs, or possibleflow paths. The amount of flow on an arc represents the differ-ence (in cycles) between the unwrapped and the wrapped phasegradients associated with that arc. The net amount of flow outof a node must be equal to the node’s surplus.

402 J. Opt. Soc. Am. A/Vol. 17, No. 3 /March 2000 C. W. Chen and H. A. Zebker

wrap(0.4 - 0.1) = 0.3wrap(0.6 – 0.4) = 0.2wrap(0.9 – 0.6) = 0.3wrap(0.1 – 0.9) = 0.2 = +1.0

wrap(0.9 – 0.3) = -0.4wrap(0.8 – 0.9) = -0.1wrap(0.5 – 0.8) = -0.3wrap(0.3 – 0.5) = -0.2 = -1.0

Chen,C.W.,andH.A.Zebker(2000),Networkapproachestotwo-dimensionalphaseunwrapping:intractabilityandtwonewalgorithms,J.Opt.Soc.Am.A,17,401-414.

Page 16: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

pathfollowingwithmaskingandresidues 1.)CalculatecorrelaKonforphasedata.2.)MaskoutallareaswithcorrelaKonlessthanacertainthresholdvalue.3.)GothroughallpixelsandidenKfyresiduelocaKons(upperlewof4pixels).4)Startwithfirstresidue,lookfornearestresidue.Drawa“line”ofmarkedpixelsbetweenthetwo.- ifresiduescancel,gotonextresidueandstartnew“tree”- otherwise,lookfornextnearestanddrawline- canalso“cancel”byconnecKngtoedge.- connectedlinesarecalledatree.5)path-integratealongremainingpixels.

Page 17: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

-

+

PosiKveresidue

NegaKveresidue

Branchcut

-

+

+

1)Createbranches(andtrees)2)Unwrapwithoutcrossing

Page 18: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

PosiKveresidue

NegaKve residue ResiduescausedbytopographiclayoverwithilluminaKonfromoneside

Good–L0 Bad–L1

bestwaytoconnectresiduesisnotalwaysobvious….

Page 19: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

ChenandZebker’sSNAPHU1)  UsesastaKsKcalesKmateof‘cost’2)  Otheralgorithmsmaysolvewithdifferentnorms(e.g.L1

orL2,seeGhigliaandPra`,1998).•  C&Z(2000)claimlownormsarebest.•  ThreestaKsKcalmodels:topography,deformaKon,or

smooth)•  L0unwrappingcanbeslow(NPhard).GMT5SARmostlyusesSNAPHU,whichisC&Z’salgorithm

h`ps://web.stanford.edu/group/radar/soawareandlinks/sw/snaphu/

ChenandZebker,2000,2001,and2002

Page 20: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

usingSNAPHUinGMTSARGMTSAR:snaphu.csh

•  MakescorrelaKonmask•  Convertgrdtobinaryforsnaphu•  Parameters:threshold_snaphuanddefomaxinconfiguraKon

file–seecomments•  DeformaKonmodeisdefault;defomax=0meanssmooth

phase(willdetrend)whiledefomax>0setsmaximumphasejump

•  CanalsouselandmaskordeformaKonmask•  Extractsparametersfromsnaphu.conf.brief in $sharedir/

snaphu/config •  snaphu.cshrunbyp2p*cshscripts•  Createsunwrap.grd

Usage:snaphu.cshcorrelaKonthresholdmaximum_disconKnuity[<r0>/<r1>/<a0>/<a1>]"Example:snaphu.csh.12401000/3000/24000/27000"

Page 21: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

phaseunwrappingfortheimpa-entIngeneralGMTSARmasksoutlowcorrelaKon,whichusuallymasksoutareaswithrandomphase.SomeKmesascenepossesseslargedecorrelatedareas.Inthesecases,SNAPHUcantake~forever.•  Increasethreshold(notalwaysagoodidea).•  Interpolate[inGMTSAR,snaphu_interpolate.csh]•  Orbuyabe�ercomputer.

•  NearestneighborinterpolaKonpreservesthetopologyofanyloopscontainingresidues

•  Unwrapped,maskedresultshouldbethesame,whetherornotweinterpolatefirst

AgramandZebker,Sparsetwo-dimensionalphaseunwrappingusingregulargridmethods,IEEEGeosci.Rem.Sens.,2009

Page 22: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

ImperialValley,CA–standard(~6hours)

ENVI_D084_2005268_2007063Standard unwrappingRunning time: 5h 57m 41sec

Page 23: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

ImperialValley,CA,interpolate(~6minutes)

ENVI_D084_2005268_2007063Interpolation unwrappingRunning time: 6m 23sec (56x speedup!)

Page 24: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

EvaluaKngmodelandphaseunwrapping

•  Howdoweevaluate?–  Lookatit–doesitlookokay?–  MaybeimpracKcalforlargedatasetsandautomaKc

processing.–  SubtractoutesKmatedmodelofdeformaKonbefore

unwrapping.–  CanbedoneiteraKvely–  Awerunwrapping,addintoregainoriginalsignal.–  CanbiasresultswithassumpKonsinmodel

Page 25: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

exampleObserved

Modeled

Residual

Deviations

Initial Final

0.2796 cy 0.1483 cy Easting (km) -> N

orth

ing

(km

) ->

cycl

es

Page 26: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

removingdeforma-onpriortounwrapping

IfanaccuratedeformaKonmodelisavailable,thenmanyoftheseproblemscanbealleviatedduringcalculaKonoftheinterferogram. • Reduceneedforunwrapping.• CanbedoneiteraKvely.• DeformaKonmodelisopKonalinputtoin�.csh(in�.cshrunbyp2p*cshscripts)

in�.cshref.PRMrep.PRM[-topotopogrd][-modelmodelgrd]

Page 27: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

persistent scatterers: 3D unwrapping

• ThePStechniqueleadstowidelyspacedpixels.PhaserelaKonshipsbetweenthesepixelsmaybechallengingtodefine.• IfwehaveaKmeseriesofinterferograms,phaseunwrappingbecomesa3dproblem.

Page 28: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

geocoding

• Gofromradarcoordinates(range,azimuth)togroundcoordinates(laKtude,longitude,orpossiblyUTM).

BonusquesKon:whathappenedhere?

Page 29: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

proj_ra2ll.csh

Usage:proj_ra2ll.cshtrans.datphase.grdphase_ll.grdtrans.dat-filegeneratedbyllt_grid2rat(ratopolonlat)phase_ra.grd-aGRDfileofphaseoranythingphase_ll.grd-outputfileinlon/lat-coordinates

proj_ra2ll.cshtrans.datphasefilt.grdphasefilt_ll.grdproj_ra2ll.cshtrans.datcorr.grdcorr_ll.grd

trans.datgeneratedbyllt_grid2rat (rangeazitopolonlat)

Page 30: Theory and pracce of phase unwrapping - UNAVCO · Fig. 1. Example network equivalent of the phase unwrapping problem. The numbers represent the 2-D array of phase samples (normalized

Chen,C.W,andH.A.Zebker,2000,Networkapproachestotwo-dimensionalphaseunwrapping:intractabilityandtwonewalgorithms,JournaloftheOpKcalSocietyofAmericaA,vol.17,pp.401-414.

Chen,C.W.,andH.A.Zebker,2001,Two-dimensionalphaseunwrappingwithuseofstaKsKcalmodelsforcostfuncKonsinnonlinearopKmizaKon,JournaloftheOpKcalSocietyofAmericaA,vol.18,pp.338-351.

Chen,C.W.andH.A.Zebker,2002,PhaseunwrappingforlargeSARinterferograms:StaKsKcalsegmentaKonandgeneralizednetworkmodels,'IEEETransacKonsonGeoscienceandRemoteSensing,vol.40,pp.1709-1719/

Ghiglia,D.C.andM.D.Pra�,1998,Two-dimensionalphaseunwrapping,493p,JohnWiley&Sons.

Goldstein,R.M.andC.Werner,1998,RadarinterferogramfilteringforgeophysicalapplicaKons,Geophys.Res.Lets.25,21,4035-4038,1998.

Goldstein,R.M.,H.A.Zebker,andC.L.Werner,Satelliteradarinterferometry:Twodimensionalphaseunwrapping,RadioScience,July-August,713-720.

Somereferences