Phase to Height without snaphu unwrapping

Hi, this is maybe an odd request, but how can I cheat the slant2height operator into working on a product that hasn’t actually been unwrapped?

My situation is this - having removed topographic phase and multilooked, my phase values are all well within a 2 pi interval (there is a distinct peak in the histogram). Therefore there isn’t strictly anything to unwrap. And whenever I run snaphu unwrapping, I end up with erroneous, unphysical results.

So I would like to skip the unwrapping step, and write my own operation to simply centre to phase values on zero, then go straight to the phase to height operator.

However, it throws up an error because it “requires at least one unwrapped phase band”. How can I bypass this check?

I have tried naming a phase band “Unw_Phase” and this didn’t solve anything.

Thank you for your advice!

I just tested and copied the phase band using the Band Maths by giving it another name (Unw_Phase_ifg…, but without the polarization)

Additionally, you have to add abs_phase in the band properties under unit

After that, I could apply the Phase to Height opertor to the unwrapped product.

1 Like

Thank you! I just came to the same conclusion by hunting in the source code.

I am using snappy so my solution will include something like

product.getBand('Unw_Phase').setUnit('abs_phase')
1 Like

I’ve actually come across another problem.

Having used snappy to produce a band with units of ‘abs_phase’, when I call phaseToHeight I now get a NullPointerException:

java.lang.NullPointerException
    at org.jlinda.core.utils.CplxContainer.<init>(CplxContainer.java:30)
    at org.jlinda.nest.gpf.Slant2HeightOp.metaMapPut(Slant2HeightOp.java:224)
    at org.jlinda.nest.gpf.Slant2HeightOp.constructSourceMetadata(Slant2HeightOp.java:176)
    at org.jlinda.nest.gpf.Slant2HeightOp.initialize(Slant2HeightOp.java:98)
    at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486)
    at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
    at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
    at org.esa.snap.core.gpf.GPF.createProductNS(GPF.java:330)
    at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:265)
    at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:198)
    at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:177)

I still have no clue how to interpret this kind of java error - can anybody suggest what might be going wrong?

Maybe this thread can help. It is sort of a workaround to try and import connected components from SNAPHU and forcing SNAPHU Import to accept the data. The same techniques might work for you and your data requirements.