How to avoid spreading NaNs when creating a stack?

Hi,
I am trying to stack a number of displacement maps and the more I add scenes the more I get NaNs when I stack all the layers together. The property NDV used is not ticked in any of the map before adding them.
I have tried with no interpolation, with nearest neighbour and bilinear.
Propagating NaN from one layer to the other is a bit counterproductive in a stack as the main idea is that some maps will provide the missing information to the others. I assume I misunderstood something?
I tried averaging but it freezes at writing at 20%

~/esa-snap/bin$ gpt Stack-Averaging img/track_82/unwrapped/Stack_B5_BL.dim
OpenJDK 64-Bit Server VM warning: Option AggressiveOpts was deprecated in version 11.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.esa.snap.runtime.Engine (file:/home/user/esa-snap/snap/modules/ext/org.esa.snap.snap-core/org-esa-snap/snap-runtime.jar) to method java.lang.ClassLoader.initializePath(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.esa.snap.runtime.Engine
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
WARNING: org.esa.snap.core.util.ServiceLoader: org.esa.snap.core.gpf.OperatorSpi: Provider eu.esa.opt.meris.sdr.aerosol.AerosolMergerOp$Spi not found
WARNING: org.esa.snap.core.util.ServiceLoader: org.esa.snap.core.gpf.OperatorSpi: Provider eu.esa.opt.meris.sdr.aerosol.ModisAerosolOp$Spi not found
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
WARNING: org.esa.snap.core.util.ServiceLoader: org.esa.snap.core.gpf.OperatorSpi: Provider eu.esa.opt.meris.sdr.aerosol.AerosolMergerOp$Spi not found
WARNING: org.esa.snap.core.util.ServiceLoader: org.esa.snap.core.gpf.OperatorSpi: Provider eu.esa.opt.meris.sdr.aerosol.ModisAerosolOp$Spi not found
Executing operator...
20%....30%....42%44%.40%....56%58%.....70%72%.....84%86%....96%. done.
INFO: org.esa.snap.core.gpf.common.WriteOp: Start writing product Stack_B5_BL to target.dim
Writing...
10%20%

Thanks

@djagula can you have a look at this? Thanks

1 Like

Did you select Maximum for the “Output Extents” in the CreateStack? Could you provide more details regarding the operators and parameters used? Thanks

Hi,
Yes I used all default values for creating a S1 unwrapped stack and then just added the layers with bandmaths. The addition creates lots of NaN. Regarding the averaging of stack it just freezes to 20%.
I am currently trying to do it with snappy and numpy but I am not always sure the data of the bands are read, probably something I don’t understand.
Thanks,