SLSTR stitching and snappy

I would like to use the SLSTR stitching operator in python, but I have not clear the parameters to insert, surely they are the name of the product files, but with which structure? and what is the name of the operator to call?

If you click on Help -> About in the GUI of the operator you see the name. It is PduStitching.
Actually, it has not many parameters. Only targetDir and optionally sourceProductPaths
Click on File -> Display Parameters or call gpt:

gpt pdustitching -h

1 Like

Thank you Marco, I had already looked at the “display parameter” box in the GUI, but the last option is definitely clear about how to insert the parameters.

it is actually clear which parameters to insert in the HashMap but the list of source product path how should be inserted? I have tried this :

parameters.put('sourceProductPaths', ( 'C:\\Program Files\\snap\\S3A_SL_1_RBT____20170921T145111_20170921T145411_20170921T164945_0179_022_253_2700_SVL_O_NR_002.SEN3\\xfdumanifest.xml' , 'C:\\Program Files\\snap\\S3A_SL_1_RBT____20170921T144811_20170921T145111_20170921T165056_0179_022_253_2520_SVL_O_NR_002.SEN3\\xfdumanifest.xml' ) )

I inserted the list of file as a python list but of course it is not recognized by the java operator.
what should be done?

It should be one String. Separate the paths by comma and now space

ah ok! because in the Help window the paths are indicated as separate strings… that was the trick then…

Dear @marpet I have problem again with the stitching operator. I last used it more than a month ago and maybe I am forgetting something about its usage. Here the lines I used :

import snappy
HashMap = snappy.jpy.get_type('java.util.HashMap')
parameters = HashMap()
parameters.put('sourceProductPaths', 'C:\\Program Files\\snap\\S3A_SL_1_RBT____20171203T173838_20171203T174138_20171203T183849_0179_025_141_0179_SVL_O_NR_002.SEN3\\xfdumanifest.xml,C:\\Program Files\\snap\\S3A_SL_1_RBT____20171203T173538_20171203T173838_20171203T184247_0179_025_141_6059_SVL_O_NR_002.SEN3\\.xfdumanifest.xml')
result = snappy.GPF.createProduct('PduStitching',parameters)

These lines return a new SAFE product but containing only the first of the two input products, without any stitching, and the processing is really quick, while the past time during the processing I could see every file of the product while being produced in the python console. What am I doing wrong?

The second path has an error.


Removing the dot should make it work.

1 Like

oh my god :slight_smile: :slight_smile: thanks!! I was sure I had copied the paths with no mistakes…