Thank you in advance!
I am still new to SNAP and am now trying to co-register images with ‘create stack’ using the snap python binding. I have a pipeline to preprocess single files using snap (apply orbit-radiometric calibration-terrain flattening-terrain correction), and can then otherwise align these nicely using the xml graphs approach-but ideally would like to continue in python.
To do individual files, I start with ProductIO:
But for the ‘create-stack’ I would like to read multiple files (ideally in a list) using the ‘ProductSet-Reader’.
*Edit: I think have found Operator().ProductSetReaderOp()
but it throws as error (see code below)
I would be grateful if you could guide me how to:
- Call the product set reader while passing a list of files (such as file locations or preprocessed products)
- Call the ‘create stack’ method taking the product-set as input
Something along the lines of:
from snappy import ProductIO, GPF, jpy, Operator GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis() HashMap = jpy.get_type('java.util.HashMap') files_list = ['C:\myGRDH_file1.dim', 'C:\myGRDH_file2.dim']` #read set of products or files product_set = Operator().ProductSetReaderOp(files_list) #******** #gives error: 'RuntimeError: no constructor found (missing JType attribute '__jinit__')' #************** #create stack params = HashMap() params.put('resamplingType', None) params.put('initialOffsetMethod', 'Product Geolocation') params.put('extent', 'Master') create_stack = GPF.createProduct('CreateStack', params, product_set)