Well, I got lost here, this is what I tried
string
string
string
this was from ./gpt StatisticsOp -h sort of gives the idea that sourceBandName, expression and validPixelExpression would be needed
I adapted the example code to this
BandConfDescriptor = jpy.get_type(‘org.esa.snap.statistics.BandConfiguration’)
bandConf1 = BandConfDescriptor()
#bandConf1.sourceBandName = ‘ndviMasked’
#bandConf1.expression = ‘average’ #>string
#BandConf1.validPixelExpression ./gpt StatisticsOp -h
Had an error (indicated that no defaults were used)
statProduct = GPF.createProduct(‘StatisticsOp’, parameters, ndviProduct)
RuntimeError: org.esa.snap.core.gpf.OperatorException: Configuration must contain either a source band name or an expression.
ok, I’ll give the band name:
BandConfDescriptor = jpy.get_type('org.esa.snap.statistics.BandConfiguration')
bandConf1 = BandConfDescriptor()
bandConf1.sourceBandName = 'ndviMasked'
#bandConf1.expression = 'average' #>string</expression>
#BandConf1.validPixelExpression
bandConf1.sourceBandName = 'ndviMasked'
AttributeError: ‘org.esa.snap.statistics.BandConfiguration’ object has no attribute ‘sourceBandName’
BandConfDescriptor = jpy.get_type('org.esa.snap.statistics.BandConfiguration')
bandConf1 = BandConfDescriptor()
print(dir(bandConf1))
[‘class’, ‘delattr’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘gt’, ‘hash’, ‘init’, ‘jinit’, ‘le’, ‘lt’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘equals’, ‘getClass’, ‘hashCode’, ‘jclass’, ‘notify’, ‘notifyAll’, ‘toString’, ‘wait’]
Where did I go wrong?
-Paula