Dear SNAP team,
I found an issue with SNAP in case of multiple NetCDF groups: when a variable in a group has the same name than another previous variable, SNAP seems to add the variable’s first parent group as suffix to the name displayed by SNAP, but in my case the first parent group of both variables are also identical because inside another parent group, and SNAP fails to open the file with the error below, tested with the latest SNAP v10 under Linux.
Maybe a simple solution could be to suffix the variable name using the full parents hierarchy?
Please, do you know when this bug will be fixed because this is blocking for us and I think a lot of other people also face to the same issue.
Thanks
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.esa.snap.rcp.actions.file.ReadProductOperation
java.lang.IllegalArgumentException: The Product ‘bug’ already contains a band with the name ‘v_gv’.
at com.bc.ceres.core.Assert.argument(Assert.java:67)
at org.esa.snap.core.datamodel.Product.addBand(Product.java:1124)
at org.esa.snap.core.datamodel.Product.addBand(Product.java:1140)
at org.esa.snap.dataio.netcdf.metadata.profiles.cf.CfBandPart.addBand(CfBandPart.java:217)
at org.esa.snap.dataio.netcdf.metadata.profiles.cf.CfBandPart.decode(CfBandPart.java:155)
at org.esa.snap.dataio.netcdf.NetCdfReadProfile.readProduct(NetCdfReadProfile.java:54)
at org.esa.snap.dataio.netcdf.DefaultNetCdfReader.readProductNodesImpl(DefaultNetCdfReader.java:62)
at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:178)
at org.esa.snap.dataio.netcdf.GenericNetCdfReader.readProductNodesImpl(GenericNetCdfReader.java:89)
at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:178)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:181)
at org.esa.snap.rcp.actions.file.ReadProductOperation.run(ReadProductOperation.java:61)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
The small NetCDF file to reproduce the issue:
bug.nc.zip (1.1 KB)
and the corresponding CDL representation if needed:
bug.cdl.zip (271 Bytes)
bug.cdl (use this command to generate the NetCDF: ncgen bug.cdl -o bug.nc):
netcdf bug {
group: g1 {
group: gv {
dimensions:
dim1 = 3 ;
dim2 = 4 ;
variables:
float v(dim1, dim2) ;
}
}
group: g2 {
group: gv {
dimensions:
dim1 = 3 ;
dim2 = 4 ;
variables:
float v(dim1, dim2) ;
}
}
group: g3 {
group: gv {
dimensions:
dim1 = 3 ;
dim2 = 4 ;
variables:
float v(dim1, dim2) ;
}
}
}