Hello all
I am learning how to mosaic two bands named ‘CI’ of two different products ‘product1’ and ‘product2’ using snappy. I have used the following code to achieve this goal:
products = jpy.array('org.esa.snap.core.datamodel.Product', 2)
Variable = jpy.get_type('org.esa.snap.core.gpf.common.MosaicOp$Variable')
vars = jpy.array('org.esa.snap.core.gpf.common.MosaicOp$Variable', 1)
products[0] = product1
products[1] = product2
parameters = HashMap()
parameters.put('westBound',-83.61)
parameters.put('eastBound',-81.79)
parameters.put('northBound',42.31)
parameters.put('southBound',41.19)
parameters.put('pixelSizeY',0.002)
parameters.put('pixelSizeX',0.002)
parameters.put('resampling','Nearest')
vars[0] = Variable('CI_demo','CI')
Mosaic = GPF.createProduct('Mosaic', parameters, products)
The code throws the error: RuntimeError: org.esa.snap.core.gpf.OperatorException
Can anyone please tell me how to resolve this error?
P.S. I was able to mosaic the products using SNAP desktop.