Snappy, processing more than one band

I’m trying to process RADARSAT-2 Imagery and I’m running into the problem where I want to process two bands but I’m not sure how to. Below is the method that I have created to calibrate and apply a speckle-filter on an image with just the VV and HH Intensities. Is there anyway I can do the calibration with just these two bands as the sourceBands/Polarizations, instead of creating two products for each band?

def MergeFcn(source1, source2):
    parameters = HashMap()
    sources = HashMap()
    target = GPF.createProduct('Merge',parameters, sources)
    return target

def CalibSpeckOp(p):
    pols = ['VV', 'HH']
    for x in pols:
        polarization = x
        parameters = HashMap()
        speckParam = HashMap()
        parameters.put('auxFile','Latest Auxiliary File')
        parameters.put('oututSigmaBand', True)
        parameters.put('sourceBands','Intensity_' + polarization)
        parameters.put('selectedPolarisations', polarization)

        speckParam.put('sourceBands', 'Sigma0_' + polarization)
        speckParam.put('filterSizeX', 5)
        speckParam.put('filterSizeY', 5)
        if x == 'VV':
            resultVV = GPF.createProduct("Calibration", parameters, p)
            speckVV = GPF.createProduct("Speckle-Filter", speckParam, resultVV)
            resultHH = GPF.createProduct("Calibration", parameters, p)
            speckHH = GPF.createProduct("Speckle-Filter", speckParam, resultHH)

    return MergeFcn(speckVV,speckHH)

Nevermind I got it. Simply change the variable to:

parameters.put('selectedPolarisations', 'HH,VV')
1 Like