outputImageScaleInDb in python snappy

Hi,

I am doing the preprocessing on snappy in python for sentinel 1 data. I try to separate the output image in db scale. The ouptut image was in SIgmaBand scale and not in db Scale. So my question is, is the calibration step the correct step for saving the output image in Scale db or should i do this in another step or does anyone knows why it is not converting to db Scale. I have tried converting linear from/to db in the following calibration step:

def do_calibration(source, polarization, pols):
print(’\tCalibration…’)
parameters = HashMap()
parameters.put(‘outputSigmaBand’, False)
if polarization == ‘DH’:
parameters.put(‘sourceBands’, ‘Intensity_HH,Intensity_HV’)
elif polarization == ‘DV’:
parameters.put(‘sourceBands’, ‘Intensity_VH,Intensity_VV’)
elif polarization == ‘SH’ or polarization == ‘HH’:
parameters.put(‘sourceBands’, ‘Intensity_HH’)
elif polarization == ‘SV’:
parameters.put(‘sourceBands’, ‘Intensity_VV’)
else:
print(“different polarization!”)
parameters.put(‘selectedPolarisations’, pols)
parameters.put(‘outputImageScaleInDb’, True)
output = GPF.createProduct(“Calibration”, parameters, source)
return output

My preprocessing is very similar to the following tutorial:

Thanks for your help

i have found a solution myself. After testing the Snap app I noticed that the conversion is not possible as described in this post: Linear to/ from db in python SNAPPY.
The solution for the snappy python users is to use the raster tools:

GPF.createProduct(“LinearToFromdB”, parameters, source)

1 Like