Different band name when writing

This is an easy problem to work around, but it doesn’t seem that it should be a problem in the first place.

When saving a band with snappy, I can’t save the TIF file with the same name as the band. It fails with this message.

It’s worse in the SNAP GUI because there is no warning, it just fails. To recreate, Subset/Export a single band as a GeoTIFF and try to name it the same as the band name.

If I add an underscore to the end of the filename, it works fine. Here is the code I use,

Hello @cndnflyr ,
Thank you for reporting this issue.
Could you provide us the SNAP log file after reproducing the error from the SNAP GUI (Help → Show Log Directory → messages.log) ?
Are there other processing steps performed before exporting the band as GeoTIFF?

Attached is the log file. The error seems to begin at line 1466. This example is a processed S2 image. Not feasible to describe all the steps that happens from Raw. But I just grabbed a raw S2 image, resampled it, and then exported as a TIF, using the same name for the output as the Band name (“B1”) and I got the same error.

INFO [org.esa.snap]: writing to output file D:\Satellite_D_XACT\CarbonRx\UER\TONNES_CARBON6.tif
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.progress.ui.RunOffEDTImpl$3
java.lang.IllegalArgumentException: The Product ‘subset_0_S2A_MSIL2A_20231011T180251_N0509_R041_T13UER_20231011T221556_CARBON RESULTS’ already contains a raster data node with the name ‘TONNES_CARBON6’.
at com.bc.ceres.core.Assert.argument(Assert.java:67)
at org.esa.snap.core.datamodel.ProductNode.setNodeName(ProductNode.java:110)
at org.esa.snap.core.datamodel.ProductNode.setName(ProductNode.java:102)
at org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter.updateProductName(BigGeoTiffProductWriter.java:371)
at org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter._writeProductNodesImpl(BigGeoTiffProductWriter.java:293)
at org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter.writeProductNodesImpl(BigGeoTiffProductWriter.java:187)
at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(AbstractProductWriter.java:111)
at org.esa.snap.core.dataio.ProductIO.writeProduct(ProductIO.java:448)
at org.esa.snap.core.dataio.ProductIO.writeProduct(ProductIO.java:436)
at org.esa.snap.rcp.actions.file.WriteProductOperation.writeProduct(WriteProductOperation.java:147)
at org.esa.snap.rcp.actions.file.WriteProductOperation.run(WriteProductOperation.java:122)
at org.netbeans.modules.progress.ui.RunOffEDTImpl$3.run(RunOffEDTImpl.java:275)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
[catch] at java.lang.Thread.run(Thread.java:748)
SEVERE [org.esa.snap]: JAI error occurred: ‘Problem occurs when computing a tile by the owner.’ at com.sun.media.jai.util.SunTileScheduler@607e6942
java.lang.IllegalStateException: no product reader for band ‘null’
messages.log (627.0 KB)

Jira ticket SNAP-3631 created