Hello,
I have had an error that has newly appeared when trying to collocate products using snappy. The following snippet of code (that used to work):
from snappy import ProductIO
from snappy import HashMap
from snappy import GPF
FILENAME1 = ‘/path/to/file’
FILENAME2 = ‘/path/to/file’
im1 = ProductIO.readProduct(FILENAME1)
im2 = ProductIO.readProduct(FILENAME2)
source = parameters = HashMap()
source.put(‘master’, im1)
source.put(‘slave’, im2)
parameters.put(‘renameMasterComponents’, True)
parameters.put(‘renameSlaveComponents’, True)
parameters.put(‘masterComponentPattern’, ‘${ORIGINAL_NAME}_M’)
parameters.put(‘slaveComponentPattern’, ‘${ORIGINAL_NAME}_S’)
parameters.put(‘resamplingType’, ‘BILINEAR_INTERPOLATION’)collocated = GPF.createProduct(‘Collocate’, parameters, source)
generates the following error:
RuntimeError: java.lang.ClassCastException: java.lang.String cannot be cast to org.esa.snap.core.datamodel.Product
The only thing I can think of is that I have updated SNAP recently. Any idea of what this could be due to? Or how I could get around this?
Max