i have read a few articles about BandMaths in snappy but still can’t manage to divide one band by another. I understand the logic for BandMaths calculations within a band, but I don’t understand how I can divide 2 bands
I have a product with 2 bands of which I want to calculate the ratio.
I have a Band A and a Band B. What I want is A/B.
Can anyone help me?
This is my code:
parameters = HashMap() BandDescriptor = jpy.get_type('org.esa.snap.core.gpf.common.BandMathsOp$BandDescriptor') targetBand_1 = BandDescriptor() targetBand_1.name = 'Intensity_VH' targetBand_2 = BandDescriptor() targetBand_2.name = 'Intensity_VV' targetBands = jpy.array('org.esa.snap.core.gpf.common.BandMathsOp$BandDescriptor', 2) targetBands = targetBand_1 targetBands = targetBand_2 parameters.put('targetBands', targetBands) parameters.put('validExpression', 'Intensity_VH / Intensity_VV') output = GPF.createProduct('BandMaths', parameters, source)
RuntimeError: java.lang.IllegalArgumentException: code is null