Convert band to dB

The Convert band to dB fails when working with AirSAR data that were previously decompressed using ENVI.
Here is the java error message:
java.lang.NullPointerException
at org.esa.snap.raster.gpf.LinearTodBOp.computeTile(LinearTodBOp.java:136)
Caused: org.esa.snap.core.gpf.OperatorException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:440)
at org.esa.snap.raster.gpf.LinearTodBOp.computeTile(LinearTodBOp.java:176)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:82)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
Caused: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:381)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at javax.media.jai.PlanarImage.getData(Unknown Source)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:449)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:435)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:75)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
[catch] at com.sun.media.jai.util.WorkerThread.run(Unknown Source)

Does it work in the SNAP GUI?

Maybe the metadata is no longer understood after processing in ENVI.

The meta data are standard ENVI without geolocation for this particular data set. I used the Raster -> Data Conversion -> Data conversion to from dB tool from the pull down menu, and it failed.
The “Linear to/from dB” option was not highlighted when I used ctrl-click on a single band in the list.
The ENVI header used to import the data in SNAP is bellow.

ENVI
description = {
AIRSAR Synthesize Result
[C:/Volumes/GP1T/Courses/EPSS150/Labs/lab8/AIRSAR/FCreek_c.dat
L:/Volumes/GP1T/Courses/EPSS150/Labs/lab8/AIRSAR/FCreek_l.dat
P:/Volumes/GP1T/Courses/EPSS150/Labs/lab8/AIRSAR/FCreek_p.dat ] [Fri Sep 18
06:05:13 2020]}
samples = 2560
lines = 2500
bands = 12
header offset = 0
file type = ENVI Standard
data type = 4
interleave = bsq
sensor type = Unknown
byte order = 0
wavelength units = Unknown
band names = {
C_HH, C_VV, C_HV, C_TP, L_HH, L_VV, L_HV, L_TP, P_HH, P_VV, P_HV, P_TP}

I just tested this:

  1. Open a Sentinel-1 image as BEAM DIMAP
  2. Export it as ENVI raster (img + hdr)
  3. Close SNAP
  4. Open the ENVI raster in SNAP
  5. Raster > Conversion > Linear to/from dB

I get an operator exception here as well. I opened the metadata of both hdr files - they are identical. I think SNAP needs the metadata from the dim file as well to treat the raster as a SAR product. Have you considered working in the BEAM DIMAP format for the previous steps and only convert to ENVI (if needed) as the very last step?

The previous step was the decompression of the .dat files and SNAP does not have the module to decompress NASA/AirSAR data.
I tried to save the data in the BEAM-DIMAP format but it failed the same way.
I am not sure what SNAP needs in the metadata to perform the conversion to dB which is a simple conversion. The operation can be done using Band Math but it has to be applied to the 12 individual bands one at a time.

right - I forgot about the decompression, sorry.
I haven’t found out which metadata exactly is required but obviously SNAP doesn’t like the input.

If you have to perform it for 12 products, have you considered applying the Band Maps via the graph processing tool?

Yes, the graph tool is a good option for now.