Mosaicing with Snappy

Hi,

I am new to Snap (have been using it for a few weeks), and I have started using Snappy in Python in order to automize some of the processes I am doing (I have a lot of images to analyse). I was wondering if there is anywhere that can show me how to Mosaic images using snappy. I am using AATSR images.

Thanks for your help!

Hi,
To code in python just you need to have information about parameters of these operators.

These information can be found in the File, Display parameters in SNAP.

Then you need to write the following code to Run:

Example for terrain correction

params = HashMap()
params.put(‘demResamplingMethod’, ‘BILINEAR_INTERPOLATION’)
params.put(‘imgResamplingMethod’, ‘BILINEAR_INTERPOLATION’)
params.put(‘demName’, ‘SRTM 3Sec’)
params.put(‘pixelSpacingInMeter’, 10.0)
params.put(‘sourceBands’, ‘Sigma0_VH’)
params.put(‘nodataValueAtSea’, False)

terrain_corrected_product = GPF.createProduct(“Terrain-Correction”, params, product)

Hi Samira,

So I have managed to get this far:

params=HashMap()
params.put('combine', 'OR')
params.put("eastBound","44.0")
params.put("westBound","-7.0")
params.put("northBound","48.0")
params.put("southBound","29.0")
params.put("pixelSizeX","0.01")
params.put("pixelSizeY","0.01")
params.put("resampling","Nearest")


products=[]
for i in range(3):
    p=ProductIO.readProduct(paths[i])
    products.append(p)

Mosaic = GPF.createProduct("Mosaic", params, products)

Where “paths” are the paths to my products. However, when I run this I’m getting the error
RuntimeError: org.esa.snap.core.gpf.OperatorException

Does anyone know what could be causing this error?

I also can´t seem to find where I can find the parameters of an operator - could you be more specific?

Thanks again!

For example to access to mosaic parameters: go to Raster-Geometric operation_mosaicing. in the new open menu go to file- dispaly parameters. look at the attached file…

Also you can use gpt -h mosaic in the command line to access to these parameters…