Hi there,
I am trying to replicate an exercise that has been already designed using the manual approach in SNAP with python in Jupyter Notebooks. The exercise is on S1 data and so far I have performed calibration and subsetting and the workflow has been smooth, but when I try to use the speckle filter operator it returns a java.lang.NullPointerException. I’m using a fresh installation of SNAP 6.0 with an integration snappy with Anaconda 2.
I’ve seen user kedziorm had a similar problem with the calibration operator and I’ve checked the recommendations from here:https://forum.step.esa.int/t/java-lang-nullpointerexception-when-using-calibration-operator-on-beam-dimap-file/3099/7. However, I seem to have none of these problems. It also seems that the Speckle Filtering Operator has been updated recently.
This piece of code looks like this (sorry if not very elegant, I am a newbie):
SpeckleOp=jpy.get_type("org.esa.s1tbx.sar.gpf.filtering.SpeckleFilterOp")
SpkOp=SpeckleOp()
SpkOp.setSourceProduct(spk_file)
SpkOp.setParameter('filter', "LEE_SPECKLE_FILTER")
SpkOp.setParameter('filtersizeX', 5)
SpkOp.setParameter('filtersizeY', 5)
SpkOp.setParameter('estimatedENL', True)
SpkOp.setParameter('enl', 1.0)
targetProduct= SpkOp.getTargetProduct()
ProductIO.writeProduct(targetProduct,"S1B_IW_GRDH_1SDV_20161015T165945_subset_Cal_Spk.dim", "BEAM-DIMAP")
spk_file.dispose()
targetProduct.dispose()
del SpkOp
del SpeckleOp
The problem is with the target product.
Do you have any ideas? Am I doing something wrong?
Thanks!
update: the Speckle Filtering on the same product works just fine in SNAP.